Skip to content

Commit 58830ac

Browse files
authored
Fix API retro-compatibility (#23)
Also update README
1 parent a20abfa commit 58830ac

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Client client = new Client();
2222
client.connect("host", 4064, "username", password, groupId);
2323
```
2424

25-
### Repository objects (projects, datasets, images)
25+
### Repository objects (projects, datasets, images, screens, wells, plates)
2626

2727
It can then be used to retrieve all the repository objects the user has access to, like projects or datasets:
2828

src/main/java/fr/igred/omero/annotations/TableWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public TableWrapper(TableData table) {
130130
* @throws AccessException Cannot access data.
131131
* @throws ExecutionException A Facility can't be retrieved or instantiated.
132132
*/
133-
public TableWrapper(Client client, ResultsTable results, Long imageId, Collection<Roi> ijRois)
133+
public TableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois)
134134
throws ServiceException, AccessException, ExecutionException {
135135
this(client, results, imageId, ijRois, ROIWrapper.IJ_PROPERTY);
136136
}
@@ -150,7 +150,7 @@ public TableWrapper(Client client, ResultsTable results, Long imageId, Collectio
150150
* @throws AccessException Cannot access data.
151151
* @throws ExecutionException A Facility can't be retrieved or instantiated.
152152
*/
153-
public TableWrapper(Client client, ResultsTable results, Long imageId, Collection<Roi> ijRois, String roiProperty)
153+
public TableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiProperty)
154154
throws ServiceException, AccessException, ExecutionException {
155155
roiProperty = ROIWrapper.checkProperty(roiProperty);
156156

@@ -395,7 +395,7 @@ public String toString() {
395395
* @throws AccessException Cannot access data.
396396
* @throws ExecutionException A Facility can't be retrieved or instantiated.
397397
*/
398-
public void addRows(Client client, ResultsTable results, Long imageId, Collection<? extends Roi> ijRois)
398+
public void addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois)
399399
throws ServiceException, AccessException, ExecutionException {
400400
this.addRows(client, results, imageId, ijRois, ROIWrapper.IJ_PROPERTY);
401401
}
@@ -415,7 +415,7 @@ public void addRows(Client client, ResultsTable results, Long imageId, Collectio
415415
* @throws AccessException Cannot access data.
416416
* @throws ExecutionException A Facility can't be retrieved or instantiated.
417417
*/
418-
public void addRows(Client client, ResultsTable results, Long imageId, Collection<? extends Roi> ijRois,
418+
public void addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois,
419419
String roiProperty)
420420
throws ServiceException, AccessException, ExecutionException {
421421
roiProperty = ROIWrapper.checkProperty(roiProperty);

src/main/java/fr/igred/omero/repository/DatasetWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public List<ImageWrapper> getImagesPairKeyValue(Client client, String key, Strin
359359
* @throws AccessException Cannot access data.
360360
* @throws ExecutionException A Facility can't be retrieved or instantiated.
361361
*/
362-
public void addImages(Client client, Iterable<? extends ImageWrapper> images)
362+
public void addImages(Client client, List<? extends ImageWrapper> images)
363363
throws ServiceException, AccessException, ExecutionException {
364364
for (ImageWrapper image : images) {
365365
addImage(client, image);

src/main/java/fr/igred/omero/roi/ROIWrapper.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import omero.model.Roi;
3232

3333
import java.util.ArrayList;
34-
import java.util.Collection;
3534
import java.util.Comparator;
3635
import java.util.LinkedHashMap;
3736
import java.util.List;
@@ -170,7 +169,7 @@ public static List<ROIWrapper> fromImageJ(List<? extends ij.gui.Roi> ijRois, Str
170169
*
171170
* @return The converted list of ImageJ ROIs.
172171
*/
173-
public static List<ij.gui.Roi> toImageJ(Collection<? extends ROIWrapper> rois) {
172+
public static List<ij.gui.Roi> toImageJ(List<? extends ROIWrapper> rois) {
174173
return toImageJ(rois, IJ_PROPERTY);
175174
}
176175

@@ -184,7 +183,7 @@ public static List<ij.gui.Roi> toImageJ(Collection<? extends ROIWrapper> rois) {
184183
*
185184
* @return The converted list of ImageJ ROIs.
186185
*/
187-
public static List<ij.gui.Roi> toImageJ(Collection<? extends ROIWrapper> rois, String property) {
186+
public static List<ij.gui.Roi> toImageJ(List<? extends ROIWrapper> rois, String property) {
188187
property = checkProperty(property);
189188
final int maxGroups = 255;
190189

@@ -223,7 +222,7 @@ public void setData(ROIData data) {
223222
*
224223
* @param shapes List of GenericShapeWrapper.
225224
*/
226-
public void addShapes(Iterable<? extends GenericShapeWrapper<?>> shapes) {
225+
public void addShapes(List<? extends GenericShapeWrapper<?>> shapes) {
227226
shapes.forEach(this::addShape);
228227
}
229228

src/test/java/fr/igred/omero/roi/ROITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void testROI2() throws Exception {
101101
public void testRoiAddShapeAndDeleteIt() throws Exception {
102102
ImageWrapper image = client.getImage(IMAGE1.id);
103103

104-
Collection<GenericShapeWrapper<?>> shapes = new ArrayList<>(4);
104+
List<GenericShapeWrapper<?>> shapes = new ArrayList<>(4);
105105
for (int i = 0; i < 4; i++) {
106106
RectangleWrapper rectangle = new RectangleWrapper();
107107
rectangle.setCoordinates(i * 2, i * 2, 10, 10);

0 commit comments

Comments
 (0)