Package fr.igred.omero
Class ObjectWrapper<T extends DataObject>
- java.lang.Object
-
- fr.igred.omero.ObjectWrapper<T>
-
- Type Parameters:
T- Subclass ofDataObject
- All Implemented Interfaces:
RemoteObject
- Direct Known Subclasses:
AnnotatableWrapper,AnnotationWrapper,ChannelWrapper,ExperimenterWrapper,GroupWrapper,PixelsWrapper,PlaneInfoWrapper,WellSampleWrapper
public abstract class ObjectWrapper<T extends DataObject> extends java.lang.Object implements RemoteObject
Generic class containing a DataObject (or a subclass) object.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedObjectWrapper(T o)Constructor of the class ObjectWrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TasDataObject()Returns the wrapped DataObject.booleancanAnnotate()Returnstrueif the object can be annotatedfalseotherwise, depending on permissions level.booleancanChgrp()Returnstrueif the object can be moved by the user currently logged in,falseotherwise, depending on permissions level.booleancanChown()Returnstrueif the object can be given by the user currently logged in,falseotherwise, depending on permissions level.booleancanDelete()Returnstrueif the object can be deleted by the user currently logged in,falseotherwise, depending on permissions level.booleancanEdit()Returnstrueif the object can be edited by the user currently logged infalseotherwise, depending on permissions level.booleancanLink()Returnstrueif the object can be linked e.g.java.sql.TimestampgetCreated()Gets the object creation datejava.lang.LonggetGroupId()Gets the group IDlonggetId()Gets the object idExperimentergetOwner()Gets the owner IDvoidsaveAndUpdate(DataManager dm)Saves and updates object.java.lang.StringtoString()Overridden to return the name of the class and the object id.static <U extends DataObject,V extends RemoteObject>
java.util.List<V>wrap(java.util.Collection<U> objects, java.util.function.Function<? super U,? extends V> mapper)Converts a DataObject list to a ObjectWrapper list, sorted bysorter.static <U extends DataObject,V extends RemoteObject,W extends java.lang.Comparable<W>>
java.util.List<V>wrap(java.util.Collection<U> objects, java.util.function.Function<? super U,? extends V> mapper, java.util.function.Function<? super V,? extends W> sorter)Converts a DataObject list to an ObjectWrapper list, sorted bysorter.
-
-
-
Field Detail
-
data
protected T extends DataObject data
Wrapped object
-
-
Constructor Detail
-
ObjectWrapper
protected ObjectWrapper(T o)
Constructor of the class ObjectWrapper.- Parameters:
o- The DataObject to wrap in the ObjectWrapper.
-
-
Method Detail
-
wrap
public static <U extends DataObject,V extends RemoteObject,W extends java.lang.Comparable<W>> java.util.List<V> wrap(java.util.Collection<U> objects, java.util.function.Function<? super U,? extends V> mapper, java.util.function.Function<? super V,? extends W> sorter)
Converts a DataObject list to an ObjectWrapper list, sorted bysorter.- Type Parameters:
U- The type of input (extends DataObject).V- The type of output (extends ObjectWrapper).W- The type used to sort the output.- Parameters:
objects- The DataObject list.mapper- The method used to map objects.sorter- The method used to sort the objects.- Returns:
- See above.
-
wrap
public static <U extends DataObject,V extends RemoteObject> java.util.List<V> wrap(java.util.Collection<U> objects, java.util.function.Function<? super U,? extends V> mapper)
Converts a DataObject list to a ObjectWrapper list, sorted bysorter.- Type Parameters:
U- The type of input (extends DataObject).V- The type of output (extends ObjectWrapper).- Parameters:
objects- The DataObject list.mapper- The method used to map objects.- Returns:
- See above.
-
asDataObject
public T asDataObject()
Returns the wrapped DataObject.- Specified by:
asDataObjectin interfaceRemoteObject- Returns:
- An object of type
ObjectWrapper.
-
getId
public long getId()
Gets the object id- Specified by:
getIdin interfaceRemoteObject- Returns:
- id.
-
getCreated
public java.sql.Timestamp getCreated()
Gets the object creation date- Specified by:
getCreatedin interfaceRemoteObject- Returns:
- creation date.
-
getOwner
public Experimenter getOwner()
Gets the owner ID- Specified by:
getOwnerin interfaceRemoteObject- Returns:
- owner id.
-
getGroupId
public java.lang.Long getGroupId()
Gets the group ID- Specified by:
getGroupIdin interfaceRemoteObject- Returns:
- group id.
-
toString
public java.lang.String toString()
Overridden to return the name of the class and the object id.- Overrides:
toStringin classjava.lang.Object
-
saveAndUpdate
public void saveAndUpdate(DataManager dm) throws java.util.concurrent.ExecutionException, ServiceException, AccessException
Saves and updates object.- Specified by:
saveAndUpdatein interfaceRemoteObject- Parameters:
dm- The data manager.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
canAnnotate
public boolean canAnnotate()
Returnstrueif the object can be annotatedfalseotherwise, depending on permissions level.- Specified by:
canAnnotatein interfaceRemoteObject- Returns:
- See above.
-
canEdit
public boolean canEdit()
Returnstrueif the object can be edited by the user currently logged infalseotherwise, depending on permissions level.- Specified by:
canEditin interfaceRemoteObject- Returns:
- See above.
-
canLink
public boolean canLink()
Returnstrueif the object can be linked e.g. image add to dataset, by the user currently logged in,falseotherwise, depending on permissions level.- Specified by:
canLinkin interfaceRemoteObject- Returns:
- See above.
-
canDelete
public boolean canDelete()
Returnstrueif the object can be deleted by the user currently logged in,falseotherwise, depending on permissions level.- Specified by:
canDeletein interfaceRemoteObject- Returns:
- See above.
-
canChgrp
public boolean canChgrp()
Returnstrueif the object can be moved by the user currently logged in,falseotherwise, depending on permissions level.- Specified by:
canChgrpin interfaceRemoteObject- Returns:
- See above.
-
canChown
public boolean canChown()
Returnstrueif the object can be given by the user currently logged in,falseotherwise, depending on permissions level.- Specified by:
canChownin interfaceRemoteObject- Returns:
- See above.
-
-