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.ObjectAbstract superclass for objects that hold OMEDS data. Delegates getters and setters toIObjectinstances. 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.AnnotationasAnnotation()Returns the hosted IObject as an Annotation.omero.model.ChannelasChannel()Returns the hosted IObject as a Well.omero.model.DatasetasDataset()Returns the hosted IObject as a Dataset.omero.model.ExperimenterasExperimenter()Returns the hosted IObject as an Experimenter.omero.model.FolderasFolder()Returns the hosted IObject as a Folder.omero.model.ExperimenterGroupasGroup()Returns the hosted IObject as an Experimenter Group.ome.model.IAnnotatedasIAnnotated()not null; may throw class-cast exceptionomero.model.ImageasImage()Returns the hosted IObject as an Image.omero.model.IObjectasIObject()not null; no exceptions.omero.model.PixelsasPixels()Returns the hosted IObject as a Pixels.omero.model.PlaneInfoasPlaneInfo()Returns the hosted IObject as a PlaneInfo.omero.model.PlateasPlate()Returns the hosted IObject as a Plate.static DataObjectasPojo(omero.model.IObject obj)Converts the passedIObjectinto its corresponding Pojo object.static java.util.SetasPojos(java.util.Collection iObjects)Converts the collection ofIObjects into the correspondingDataObjectsstatic java.util.MapasPojos(java.util.Map iObjects)Converts the map ofIObjects into the correspondingDataObjectsomero.model.ProjectasProject()Returns the hosted IObject as a Project.omero.model.ScreenasScreen()Returns the hosted IObject as a Screen.omero.model.WellasWell()Returns the hosted IObject as a Well.omero.model.WellSampleasWellSample()Returns the hosted IObject as a Well.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()Returns the creation time of the object.protected omero.model.DetailsgetDetails()Returns the details of the object.longgetGroupId()Returns the id of the group.longgetId()Returns the database id of the IObject or-1ifnullExperimenterDatagetOwner()Returns the owner of the object.PermissionDatagetPermissions()Returns the permission of the object.java.sql.TimestampgetUpdated()Returns the updated time of the object.protected intgetVersion()Returns the version of the object if the object is immutable,falseotherwise.booleanisDirty()Returnstrueif setter value has modified the value of the stored IObject,falseotherwise.booleanisLoaded()Returnstrueif the object is loaded,falseotherwise.protected booleannullDetails()Returnstrueif the details arenullotherwisefalseotherwise.protected doublenullSafe(java.lang.Double d)protected floatnullSafe(java.lang.Float f)protected intnullSafe(java.lang.Integer i)protected longnullSafe(java.lang.Long l)protected doublenullSafe(omero.model.Length l)protected doublenullSafe(omero.RDouble d)protected floatnullSafe(omero.RFloat f)protected intnullSafe(omero.RInt i)protected voidsetDirty(boolean dirty)Sets totrueif the value has been modified,otherwise. voidsetId(long id)Sets the database id.protected voidsetValue(omero.model.IObject value)Sets theIObject.protected voidsetVersion(int version)Sets the version of the object if it is immutable.protected java.sql.TimestamptimeOfEvent(omero.model.Event event)java.lang.StringtoString()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 ofIObjects into the correspondingDataObjects- Parameters:
iObjects- The map to handle.- Returns:
- See above.
-
asPojos
public static java.util.Map asPojos(java.util.Map iObjects)
Converts the map ofIObjects into the correspondingDataObjects- Parameters:
iObjects- The map to handle.- Returns:
- See above.
-
asPojo
public static DataObject asPojo(omero.model.IObject obj)
Converts the passedIObjectinto 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()
Returnstrueif setter value has modified the value of the stored IObject,falseotherwise.- Returns:
- See above.
-
setDirty
protected void setDirty(boolean dirty)
Sets totrueif the value has been modified,otherwise. - Parameters:
dirty- The value to set.
-
getId
public long getId()
Returns the database id of the IObject or-1ifnull- 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,falseotherwise.- 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()
Returnstrueif the object is loaded,falseotherwise.- 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:
toStringin 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()
Returnstrueif the details arenullotherwisefalseotherwise.- 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()
Returnstrueif the object can be annotatedfalseotherwise, depending on permissions level.- Returns:
- See above.
-
canEdit
public boolean canEdit()
Returnstrueif the object can be edited by the user currently logged infalseotherwise, depending on permissions level.- 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.- Returns:
- See above.
-
canDelete
public boolean canDelete()
Returnstrueif the object can be deleted by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
canChgrp
public boolean canChgrp()
Returnstrueif the object can be moved by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
canChown
public boolean canChown()
Returnstrueif the object can be given by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
-