T
- Subclass of DataObject
public abstract class ObjectWrapper<T extends DataObject> extends Object implements RemoteObject
Modifier | Constructor and Description |
---|---|
protected |
ObjectWrapper(T o)
Constructor of the class ObjectWrapper.
|
Modifier and Type | Method and Description |
---|---|
T |
asDataObject()
Returns the wrapped DataObject.
|
boolean |
canAnnotate()
Returns
true if the object can be annotated false otherwise, depending on permissions level. |
boolean |
canChgrp()
Returns
true if the object can be moved by the user currently logged in, false otherwise,
depending on permissions level. |
boolean |
canChown()
Returns
true if the object can be given by the user currently logged in, false otherwise,
depending on permissions level. |
boolean |
canDelete()
Returns
true if the object can be deleted by the user currently logged in, false otherwise,
depending on permissions level. |
boolean |
canEdit()
Returns
true if the object can be edited by the user currently logged in false otherwise,
depending on permissions level. |
boolean |
canLink()
Returns
true if the object can be linked e.g. image add to dataset, by the user currently logged in,
false otherwise, depending on permissions level. |
Timestamp |
getCreated()
Gets the time when the object was created.
|
Long |
getGroupId()
Gets the group ID
|
long |
getId()
Gets the object id
|
Experimenter |
getOwner()
Gets the owner ID
|
Timestamp |
getUpdated()
Gets the time when the object was last updated.
|
void |
saveAndUpdate(DataManager dm)
Saves and updates object.
|
String |
toString()
Overridden to return the name of the class and the object id.
|
static <U extends DataObject,V extends RemoteObject> |
wrap(Collection<U> objects,
Function<? super U,? extends V> mapper)
Converts a DataObject list to a ObjectWrapper list, sorted by
sorter . |
static <U extends DataObject,V extends RemoteObject,W extends Comparable<W>> |
wrap(Collection<U> objects,
Function<? super U,? extends V> mapper,
Function<? super V,? extends W> sorter)
Converts a DataObject list to an ObjectWrapper list, sorted by
sorter . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
distinct, flatten, getElementsOf
protected T extends DataObject data
protected ObjectWrapper(T o)
o
- The DataObject to wrap in the ObjectWrapper.public static <U extends DataObject,V extends RemoteObject,W extends Comparable<W>> List<V> wrap(Collection<U> objects, Function<? super U,? extends V> mapper, Function<? super V,? extends W> sorter)
sorter
.U
- The type of input (extends DataObject).V
- The type of output (extends ObjectWrapper).W
- The type used to sort the output.objects
- The DataObject list.mapper
- The method used to map objects.sorter
- The method used to sort the objects.public static <U extends DataObject,V extends RemoteObject> List<V> wrap(Collection<U> objects, Function<? super U,? extends V> mapper)
sorter
.U
- The type of input (extends DataObject).V
- The type of output (extends ObjectWrapper).objects
- The DataObject list.mapper
- The method used to map objects.public T asDataObject()
asDataObject
in interface RemoteObject
T
.public long getId()
getId
in interface RemoteObject
public Timestamp getCreated()
getCreated
in interface RemoteObject
public Timestamp getUpdated()
getUpdated
in interface RemoteObject
public Experimenter getOwner()
getOwner
in interface RemoteObject
public Long getGroupId()
getGroupId
in interface RemoteObject
public String toString()
public void saveAndUpdate(DataManager dm) throws ExecutionException, ServiceException, AccessException
saveAndUpdate
in interface RemoteObject
dm
- The data manager.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public boolean canAnnotate()
true
if the object can be annotated false
otherwise, depending on permissions level.canAnnotate
in interface RemoteObject
public boolean canEdit()
true
if the object can be edited by the user currently logged in false
otherwise,
depending on permissions level.canEdit
in interface RemoteObject
public boolean canLink()
true
if the object can be linked e.g. image add to dataset, by the user currently logged in,
false
otherwise, depending on permissions level.canLink
in interface RemoteObject
public boolean canDelete()
true
if the object can be deleted by the user currently logged in, false
otherwise,
depending on permissions level.canDelete
in interface RemoteObject
public boolean canChgrp()
true
if the object can be moved by the user currently logged in, false
otherwise,
depending on permissions level.canChgrp
in interface RemoteObject
public boolean canChown()
true
if the object can be given by the user currently logged in, false
otherwise,
depending on permissions level.canChown
in interface RemoteObject
Copyright © 2020–2023 GReD. All rights reserved.