Skip to content

Commit

Permalink
Fix TagAnnotation return type
Browse files Browse the repository at this point in the history
  • Loading branch information
ppouchin committed Dec 2, 2024
1 parent f47c3bb commit 02f735c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ default List<TagAnnotation> getTags(String name)
* @throws ServiceException Cannot connect to OMERO.
* @throws NoSuchElementException No element with this ID.
*/
TagAnnotationWrapper getTag(Long id)
TagAnnotation getTag(Long id)
throws AccessException, ServiceException;


Expand Down
12 changes: 6 additions & 6 deletions src/main/java/fr/igred/omero/client/BrowserWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.annotations.MapAnnotation;
import fr.igred.omero.annotations.MapAnnotationWrapper;
import fr.igred.omero.annotations.TagAnnotation;
import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.containers.Dataset;
import fr.igred.omero.containers.DatasetWrapper;
Expand Down Expand Up @@ -50,7 +51,6 @@
import omero.gateway.model.TagAnnotationData;
import omero.gateway.model.WellData;
import omero.model.IObject;
import omero.model.TagAnnotation;

import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -558,14 +558,14 @@ public List<Folder> getFolders(Long... ids)
* @throws ServiceException Cannot connect to OMERO.
*/
@Override
public List<fr.igred.omero.annotations.TagAnnotation> getTags()
public List<TagAnnotation> getTags()
throws AccessException, ServiceException {
String klass = TagAnnotation.class.getSimpleName();
String klass = omero.model.TagAnnotation.class.getSimpleName();
List<IObject> os = call(getQueryService(),
qs -> qs.findAll(klass, null),
"Cannot get tags");
return os.stream()
.map(TagAnnotation.class::cast)
.map(omero.model.TagAnnotation.class::cast)
.map(TagAnnotationData::new)
.map(TagAnnotationWrapper::new)
.sorted(Comparator.comparing(RemoteObject::getId))
Expand All @@ -585,7 +585,7 @@ public List<fr.igred.omero.annotations.TagAnnotation> getTags()
* @throws NoSuchElementException No element with this ID.
*/
@Override
public TagAnnotationWrapper getTag(Long id)
public TagAnnotation getTag(Long id)
throws AccessException, ServiceException {
IObject o = call(getQueryService(),
qs -> qs.find(TagAnnotation.class.getSimpleName(), id),
Expand All @@ -595,7 +595,7 @@ public TagAnnotationWrapper getTag(Long id)
String msg = format("Tag %d doesn't exist in this context", id);
throw new NoSuchElementException(msg);
} else {
tag = new TagAnnotationData((TagAnnotation) requireNonNull(o));
tag = new TagAnnotationData((omero.model.TagAnnotation) requireNonNull(o));
}
return new TagAnnotationWrapper(tag);
}
Expand Down

0 comments on commit 02f735c

Please sign in to comment.