Package omero.gateway.model
Class DataObject
- java.lang.Object
-
- omero.gateway.model.DataObject
-
- Direct Known Subclasses:
AnnotationData
,ChannelAcquisitionData
,ChannelData
,DatasetData
,DetectorData
,DichroicData
,ExperimenterData
,FileData
,FilesetData
,FilterData
,FilterSetData
,FolderData
,GroupData
,ImageAcquisitionData
,ImageData
,InstrumentData
,LightPathData
,LightSourceData
,ObjectiveData
,OTFData
,PixelsData
,PlaneInfoData
,PlateAcquisitionData
,PlateData
,ProjectData
,ROIData
,ScreenData
,ShapeData
,ShapeSettingsData
,WellData
,WellSampleData
public abstract class DataObject extends java.lang.Object
Abstract superclass for objects that hold OMEDS data. Delegates getters and setters toIObject
instances. Modifications are propagated. Not thread-safe.- Since:
- OME2.2
-
-
Constructor Summary
Constructors Constructor Description DataObject()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description omero.model.Annotation
asAnnotation()
Returns the hosted IObject as an Annotation.omero.model.Channel
asChannel()
Returns the hosted IObject as a Well.omero.model.Dataset
asDataset()
Returns the hosted IObject as a Dataset.omero.model.Experimenter
asExperimenter()
Returns the hosted IObject as an Experimenter.omero.model.Folder
asFolder()
Returns the hosted IObject as a Folder.omero.model.ExperimenterGroup
asGroup()
Returns the hosted IObject as an Experimenter Group.ome.model.IAnnotated
asIAnnotated()
not null; may throw class-cast exceptionomero.model.Image
asImage()
Returns the hosted IObject as an Image.omero.model.IObject
asIObject()
not null; no exceptions.omero.model.Pixels
asPixels()
Returns the hosted IObject as a Pixels.omero.model.PlaneInfo
asPlaneInfo()
Returns the hosted IObject as a PlaneInfo.omero.model.Plate
asPlate()
Returns the hosted IObject as a Plate.static DataObject
asPojo(omero.model.IObject obj)
Converts the passedIObject
into its corresponding Pojo object.static java.util.Set
asPojos(java.util.Collection iObjects)
Converts the collection ofIObject
s into the correspondingDataObject
sstatic java.util.Map
asPojos(java.util.Map iObjects)
Converts the map ofIObject
s into the correspondingDataObject
somero.model.Project
asProject()
Returns the hosted IObject as a Project.omero.model.Screen
asScreen()
Returns the hosted IObject as a Screen.omero.model.Well
asWell()
Returns the hosted IObject as a Well.omero.model.WellSample
asWellSample()
Returns the hosted IObject as a Well.boolean
canAnnotate()
Returnstrue
if the object can be annotatedfalse
otherwise, depending on permissions level.boolean
canChgrp()
Returnstrue
if the object can be moved by the user currently logged in,false
otherwise, depending on permissions level.boolean
canChown()
Returnstrue
if the object can be given by the user currently logged in,false
otherwise, depending on permissions level.boolean
canDelete()
Returnstrue
if the object can be deleted by the user currently logged in,false
otherwise, depending on permissions level.boolean
canEdit()
Returnstrue
if the object can be edited by the user currently logged infalse
otherwise, depending on permissions level.boolean
canLink()
Returnstrue
if the object can be linked e.g.java.sql.Timestamp
getCreated()
Returns the creation time of the object.protected omero.model.Details
getDetails()
Returns the details of the object.long
getGroupId()
Returns the id of the group.long
getId()
Returns the database id of the IObject or-1
ifnull
ExperimenterData
getOwner()
Returns the owner of the object.PermissionData
getPermissions()
Returns the permission of the object.java.sql.Timestamp
getUpdated()
Returns the updated time of the object.protected int
getVersion()
Returns the version of the object if the object is immutable,false
otherwise.boolean
isDirty()
Returnstrue
if setter value has modified the value of the stored IObject,false
otherwise.boolean
isLoaded()
Returnstrue
if the object is loaded,false
otherwise.protected boolean
nullDetails()
Returnstrue
if the details arenull
otherwisefalse
otherwise.protected double
nullSafe(java.lang.Double d)
protected float
nullSafe(java.lang.Float f)
protected int
nullSafe(java.lang.Integer i)
protected long
nullSafe(java.lang.Long l)
protected double
nullSafe(omero.model.Length l)
protected double
nullSafe(omero.RDouble d)
protected float
nullSafe(omero.RFloat f)
protected int
nullSafe(omero.RInt i)
protected void
setDirty(boolean dirty)
Sets totrue
if the value has been modified,otherwise. void
setId(long id)
Sets the database id.protected void
setValue(omero.model.IObject value)
Sets theIObject
.protected void
setVersion(int version)
Sets the version of the object if it is immutable.protected java.sql.Timestamp
timeOfEvent(omero.model.Event event)
java.lang.String
toString()
Overridden to return the name of the class and the object id.
-
-
-
Method Detail
-
asPojos
public static java.util.Set asPojos(java.util.Collection iObjects)
Converts the collection ofIObject
s into the correspondingDataObject
s- Parameters:
iObjects
- The map to handle.- Returns:
- See above.
-
asPojos
public static java.util.Map asPojos(java.util.Map iObjects)
Converts the map ofIObject
s into the correspondingDataObject
s- Parameters:
iObjects
- The map to handle.- Returns:
- See above.
-
asPojo
public static DataObject asPojo(omero.model.IObject obj)
Converts the passedIObject
into its corresponding Pojo object.- Parameters:
obj
- The object to convert.- Returns:
- See above.
-
setValue
protected void setValue(omero.model.IObject value)
Sets theIObject
.- Parameters:
value
- The value to set.
-
isDirty
public boolean isDirty()
Returnstrue
if setter value has modified the value of the stored IObject,false
otherwise.- Returns:
- See above.
-
setDirty
protected void setDirty(boolean dirty)
Sets totrue
if the value has been modified,otherwise. - Parameters:
dirty
- The value to set.
-
getId
public long getId()
Returns the database id of the IObject or-1
ifnull
- Returns:
- See above.
-
setId
public void setId(long id)
Sets the database id.- Parameters:
id
- The value to set.
-
getVersion
protected int getVersion()
Returns the version of the object if the object is immutable,false
otherwise.- Returns:
- See above.
-
setVersion
protected void setVersion(int version)
Sets the version of the object if it is immutable.- Parameters:
version
- The value to set.
-
isLoaded
public boolean isLoaded()
Returnstrue
if the object is loaded,false
otherwise.- Returns:
- See above.
-
getOwner
public ExperimenterData getOwner()
Returns the owner of the object.- Returns:
- See above.
-
getPermissions
public PermissionData getPermissions()
Returns the permission of the object.- Returns:
- See above.
-
toString
public java.lang.String toString()
Overridden to return the name of the class and the object id.- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
nullSafe
protected int nullSafe(java.lang.Integer i)
-
nullSafe
protected int nullSafe(omero.RInt i)
-
nullSafe
protected long nullSafe(java.lang.Long l)
-
nullSafe
protected double nullSafe(java.lang.Double d)
-
nullSafe
protected float nullSafe(java.lang.Float f)
-
nullSafe
protected float nullSafe(omero.RFloat f)
-
nullSafe
protected double nullSafe(omero.RDouble d)
-
nullSafe
protected double nullSafe(omero.model.Length l)
-
timeOfEvent
protected java.sql.Timestamp timeOfEvent(omero.model.Event event)
-
nullDetails
protected boolean nullDetails()
Returnstrue
if the details arenull
otherwisefalse
otherwise.- Returns:
- See above.
-
getDetails
protected omero.model.Details getDetails()
Returns the details of the object.- Returns:
- See above.
-
getCreated
public java.sql.Timestamp getCreated()
Returns the creation time of the object.- Returns:
- See above.
-
getUpdated
public java.sql.Timestamp getUpdated()
Returns the updated time of the object.- Returns:
- See above.
-
getGroupId
public long getGroupId()
Returns the id of the group.- Returns:
- See above.
-
asIObject
public omero.model.IObject asIObject()
not null; no exceptions.- Returns:
- not null IObject
-
asIAnnotated
public ome.model.IAnnotated asIAnnotated()
not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asExperimenter
public omero.model.Experimenter asExperimenter()
Returns the hosted IObject as an Experimenter. Not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asGroup
public omero.model.ExperimenterGroup asGroup()
Returns the hosted IObject as an Experimenter Group. Not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asAnnotation
public omero.model.Annotation asAnnotation()
Returns the hosted IObject as an Annotation. Not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asImage
public omero.model.Image asImage()
Returns the hosted IObject as an Image. Not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asDataset
public omero.model.Dataset asDataset()
Returns the hosted IObject as a Dataset. Not null; may throw class-cast exception- Returns:
- not null IObject
- Throws:
java.lang.ClassCastException
-
asProject
public omero.model.Project asProject()
Returns the hosted IObject as a Project. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asFolder
public omero.model.Folder asFolder()
Returns the hosted IObject as a Folder. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asPixels
public omero.model.Pixels asPixels()
Returns the hosted IObject as a Pixels. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asScreen
public omero.model.Screen asScreen()
Returns the hosted IObject as a Screen. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asPlate
public omero.model.Plate asPlate()
Returns the hosted IObject as a Plate. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asWell
public omero.model.Well asWell()
Returns the hosted IObject as a Well. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asWellSample
public omero.model.WellSample asWellSample()
Returns the hosted IObject as a Well. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asChannel
public omero.model.Channel asChannel()
Returns the hosted IObject as a Well. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
asPlaneInfo
public omero.model.PlaneInfo asPlaneInfo()
Returns the hosted IObject as a PlaneInfo. Not null; may throw class-cast exception- Returns:
- See above
- Throws:
java.lang.ClassCastException
-
canAnnotate
public boolean canAnnotate()
Returnstrue
if the object can be annotatedfalse
otherwise, depending on permissions level.- Returns:
- See above.
-
canEdit
public boolean canEdit()
Returnstrue
if the object can be edited by the user currently logged infalse
otherwise, depending on permissions level.- Returns:
- See above.
-
canLink
public boolean canLink()
Returnstrue
if the object can be linked e.g. image add to dataset, by the user currently logged in,false
otherwise, depending on permissions level.- Returns:
- See above.
-
canDelete
public boolean canDelete()
Returnstrue
if the object can be deleted by the user currently logged in,false
otherwise, depending on permissions level.- Returns:
- See above.
-
canChgrp
public boolean canChgrp()
Returnstrue
if the object can be moved by the user currently logged in,false
otherwise, depending on permissions level.- Returns:
- See above.
-
canChown
public boolean canChown()
Returnstrue
if the object can be given by the user currently logged in,false
otherwise, depending on permissions level.- Returns:
- See above.
-
-