Skip to content

Commit

Permalink
Fix API retro-compatibility (#23)
Browse files Browse the repository at this point in the history
Also update README
  • Loading branch information
ppouchin authored Apr 4, 2022
1 parent a20abfa commit 58830ac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Client client = new Client();
client.connect("host", 4064, "username", password, groupId);
```

### Repository objects (projects, datasets, images)
### Repository objects (projects, datasets, images, screens, wells, plates)

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

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/fr/igred/omero/annotations/TableWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public TableWrapper(TableData table) {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
public TableWrapper(Client client, ResultsTable results, Long imageId, Collection<Roi> ijRois)
public TableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois)
throws ServiceException, AccessException, ExecutionException {
this(client, results, imageId, ijRois, ROIWrapper.IJ_PROPERTY);
}
Expand All @@ -150,7 +150,7 @@ public TableWrapper(Client client, ResultsTable results, Long imageId, Collectio
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
public TableWrapper(Client client, ResultsTable results, Long imageId, Collection<Roi> ijRois, String roiProperty)
public TableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiProperty)
throws ServiceException, AccessException, ExecutionException {
roiProperty = ROIWrapper.checkProperty(roiProperty);

Expand Down Expand Up @@ -395,7 +395,7 @@ public String toString() {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
public void addRows(Client client, ResultsTable results, Long imageId, Collection<? extends Roi> ijRois)
public void addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois)
throws ServiceException, AccessException, ExecutionException {
this.addRows(client, results, imageId, ijRois, ROIWrapper.IJ_PROPERTY);
}
Expand All @@ -415,7 +415,7 @@ public void addRows(Client client, ResultsTable results, Long imageId, Collectio
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
public void addRows(Client client, ResultsTable results, Long imageId, Collection<? extends Roi> ijRois,
public void addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois,
String roiProperty)
throws ServiceException, AccessException, ExecutionException {
roiProperty = ROIWrapper.checkProperty(roiProperty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public List<ImageWrapper> getImagesPairKeyValue(Client client, String key, Strin
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
public void addImages(Client client, Iterable<? extends ImageWrapper> images)
public void addImages(Client client, List<? extends ImageWrapper> images)
throws ServiceException, AccessException, ExecutionException {
for (ImageWrapper image : images) {
addImage(client, image);
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/fr/igred/omero/roi/ROIWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import omero.model.Roi;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -170,7 +169,7 @@ public static List<ROIWrapper> fromImageJ(List<? extends ij.gui.Roi> ijRois, Str
*
* @return The converted list of ImageJ ROIs.
*/
public static List<ij.gui.Roi> toImageJ(Collection<? extends ROIWrapper> rois) {
public static List<ij.gui.Roi> toImageJ(List<? extends ROIWrapper> rois) {
return toImageJ(rois, IJ_PROPERTY);
}

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

Expand Down Expand Up @@ -223,7 +222,7 @@ public void setData(ROIData data) {
*
* @param shapes List of GenericShapeWrapper.
*/
public void addShapes(Iterable<? extends GenericShapeWrapper<?>> shapes) {
public void addShapes(List<? extends GenericShapeWrapper<?>> shapes) {
shapes.forEach(this::addShape);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/fr/igred/omero/roi/ROITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testROI2() throws Exception {
public void testRoiAddShapeAndDeleteIt() throws Exception {
ImageWrapper image = client.getImage(IMAGE1.id);

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

0 comments on commit 58830ac

Please sign in to comment.