Package net.sf.basedb.core
Enum Class Item
- All Implemented Interfaces:
Serializable
,Comparable<Item>
,java.lang.constant.Constable
This class defines constants for various items in BASE.
- Version:
- 2.0
- Author:
- Samuel
- Last modified
- $Date: 2023-06-07 08:47:11 +0200 (Wed, 07 Jun 2023) $
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Helper class to make it easier to set up the defined permissions.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe item is anAnnotation
.The item is anAnnotationSet
.The item is anAnnotationType
.The item is anAnnotationTypeCategory
.The item is anAnyToAny
link.The item is anArrayBatch
.The item is anArrayDesign
.The item is anArrayDesignBlock
.The item is aArrayDesignPlate
connecter.The item is anArraySlide
.The item is aBioAssay
The item is aBioAssaySet
The item is aBioMaterialEvent
.The item is aBioPlate
The item is aBioPlateEvent
The item is aBioPlateEventParticipant
The item is aBioPlateEventType
The item is aBioPlateType
.The item is aBioSource
.The item is aBioWell
The item is aChangeHistory
entry.Virtual item representing the new and old values column inChangeHistory
which need special access permissions.The item is anClient
.The item is anClientDefaultSetting
.The item is aDataCube
The item is aDataCubeColumn
The item is aDataCubeExtraValue
The item is aDataCubeFilter
The item is aDataCubeLayer
The item is aDataFileType
The item is aDerivedBioAssay
.The item is aDirectory
.The item is aDiskUsage
.The item is anExperiment
The item is anExtract
.The item is anExtraValue
The item is anExtraValueType
The item is aFeature
.The item is aFile
.The item is aFileServer
.The item is aFileSet
The item is aFileSetMember
The item is aFormula
The item is anGlobalDefaultSetting
.The item is aGroup
.The item is aHardware
.The item is aHelp
.The item is anItemKey
.The item is anItemList
The item is aItemSubtype
.The item is aItemSubtypeFileType
The item is aJob
The item is aJobAgent
The item is aJobAgentSettings
The item is aKit
.The item is aMessage
.The item is aMimeType
.The item is aNews
.The item is aPermissionTemplate
.The item is aPhysicalBioAssay
.The item is aPlate
.The item is aPlateEvent
.The item is aPlateEventType
.The item is aPlateGeometry
.The item is aPlateMapping
.The item is aPlateType
.The item is aPlatform
The item is aPlatformFileType
The item is aPlatformVariant
The item is aPluginConfiguration
The item is aPluginDefinition
The item is aPluginType
The item is aProject
.The item is aProjectKey
.The item is aProtocol
.The item is aQuantity
.The item is aQuota
.The item is aQuotaType
.The item is aRawBioAssay
.The item is aRawData
spot.The item is aReporter
.The item is aReporterCloneTemplate
.The item is aReporterType
.The item is aReporterScore
.The item is aReporterType
.The item is aRole
.The item is aRoleKey
.The item is aRootRawBioAssay
.The item is aSample
.The item is anSession
.The item is anSetting
.The item is aSoftware
.Representing spot data, not an actual item.The item is aSyncFilter
Not an item as susch.The item is aTag
.The item is aTransformation
The item is aUnit
.The item is aUser
.The item is anUserClientSetting
.The item is anUserDefaultSetting
.The item is anUserDevice
.The item is aVirtualDb
The item is aWell
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final String
private final Constructor<? extends BasicItem>
private final Set<Permission>
static final Comparator<Identifiable>
private final float
private final String
private final Method
private final Method
(package private) static int
private final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Item
Get theItem
object when you know either the item or data class.static Item
fromDataClass
(Class<? extends BasicData> dataClass) Get theItem
object when you know the data class.static Item
fromDataObject
(BasicData data) Get theItem
object when you have a data layer object.static Item
fromItemClass
(Class<? extends BasicItem> itemClass) Get theItem
object when you know the item class.static Item
fromValue
(int value) Get theItem
object when you know the integer code.getAlias()
Get the alias for this item, which is used in queries,<T extends BasicItem>
TGet the item of the type represented by this enumeration constant with the specified id.(package private) <T extends BasicItem>
Constructor<T>Get the default constructor for new objects of this type.Get the data object that is used to store information in the database for items of this type.Get the permissions which are meaningful to assign to an item if this type.float
Get a value indicating the deletion order.Get the class object that is used to handle items of this type.getQuery()
Get a query returning items of this type.int
getValue()
Get the integer value that is used when storing an item to the database.boolean
Is this item representing a BasicItem object or not?boolean
Check ifgetQuery()
is supported by this item type.toString()
static Item
Returns the enum constant of this class with the specified name.static Item[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SYSTEM
Not an item as susch. Used for setting system permissions to role keys. -
USER
The item is aUser
. -
GROUP
The item is aGroup
. -
ROLE
The item is aRole
. -
PROJECT
The item is aProject
. -
ITEMKEY
The item is anItemKey
. -
PROJECTKEY
The item is aProjectKey
. -
ROLEKEY
The item is aRoleKey
. -
PERMISSIONTEMPLATE
The item is aPermissionTemplate
. -
CLIENT
The item is anClient
. -
HELP
The item is aHelp
. -
SESSION
The item is anSession
. -
SETTING
The item is anSetting
. -
GLOBALDEFAULTSETTING
The item is anGlobalDefaultSetting
. -
USERDEFAULTSETTING
The item is anUserDefaultSetting
. -
CLIENTDEFAULTSETTING
The item is anClientDefaultSetting
. -
USERCLIENTSETTING
The item is anUserClientSetting
. -
USERDEVICE
The item is anUserDevice
. -
QUOTA
The item is aQuota
. -
QUOTATYPE
The item is aQuotaType
. -
DISKUSAGE
The item is aDiskUsage
. -
FILE
The item is aFile
. -
DIRECTORY
The item is aDirectory
. -
MIMETYPE
The item is aMimeType
. -
FILESERVER
The item is aFileServer
. -
PROTOCOL
The item is aProtocol
. -
HARDWARE
The item is aHardware
. -
SOFTWARE
The item is aSoftware
. -
KIT
The item is aKit
.- Since:
- 3.7
-
NEWS
The item is aNews
. -
MESSAGE
The item is aMessage
. -
ANYTOANY
The item is anAnyToAny
link. -
ITEMLIST
The item is anItemList
-
SYNCFILTER
The item is aSyncFilter
-
CHANGEHISTORY
The item is aChangeHistory
entry. -
CHANGEHISTORY_VALUES
Virtual item representing the new and old values column inChangeHistory
which need special access permissions. -
ITEMSUBTYPE
The item is aItemSubtype
. -
ITEMSUBTYPEFILETYPE
The item is aItemSubtypeFileType
-
REPORTER
The item is aReporter
. -
REPORTERTYPE
The item is aReporterType
. -
REPORTERLIST
The item is aReporterType
. -
REPORTERSCORE
The item is aReporterScore
. This item is not a BasicItem. -
REPORTERCLONETEMPLATE
The item is aReporterCloneTemplate
.- Since:
- 3.1
-
ANNOTATIONSET
The item is anAnnotationSet
. -
ANNOTATION
The item is anAnnotation
. -
ANNOTATIONTYPE
The item is anAnnotationType
. -
ANNOTATIONTYPECATEGORY
The item is anAnnotationTypeCategory
. -
QUANTITY
The item is aQuantity
. -
UNIT
The item is aUnit
. -
BIOSOURCE
The item is aBioSource
. -
SAMPLE
The item is aSample
. -
EXTRACT
The item is anExtract
. -
BIOMATERIALEVENT
The item is aBioMaterialEvent
. -
TAG
The item is aTag
. -
BIOPLATE
The item is aBioPlate
-
BIOWELL
The item is aBioWell
-
BIOPLATETYPE
The item is aBioPlateType
.- Since:
- 2.16
-
BIOPLATEEVENT
The item is aBioPlateEvent
- Since:
- 2.17
-
BIOPLATEEVENTPARTICIPANT
The item is aBioPlateEventParticipant
- Since:
- 2.17
-
BIOPLATEEVENTTYPE
The item is aBioPlateEventType
- Since:
- 2.17
-
PLATEGEOMETRY
The item is aPlateGeometry
. -
PLATE
The item is aPlate
. -
PLATETYPE
The item is aPlateType
. -
PLATEEVENT
The item is aPlateEvent
. -
PLATEEVENTTYPE
The item is aPlateEventType
. -
WELL
The item is aWell
. -
PLATEMAPPING
The item is aPlateMapping
. -
ARRAYDESIGN
The item is anArrayDesign
. -
ARRAYBATCH
The item is anArrayBatch
. -
ARRAYSLIDE
The item is anArraySlide
. -
ARRAYDESIGNBLOCK
The item is anArrayDesignBlock
. -
FEATURE
The item is aFeature
. -
ARRAYDESIGNPLATE
The item is aArrayDesignPlate
connecter. -
PHYSICALBIOASSAY
The item is aPhysicalBioAssay
. -
DERIVEDBIOASSAY
The item is aDerivedBioAssay
. -
RAWBIOASSAY
The item is aRawBioAssay
. -
ROOTRAWBIOASSAY
The item is aRootRawBioAssay
.- Since:
- 3.6
-
RAWDATA
The item is aRawData
spot. -
PLUGINTYPE
The item is aPluginType
-
PLUGINDEFINITION
The item is aPluginDefinition
-
PLUGINCONFIGURATION
The item is aPluginConfiguration
-
JOB
The item is aJob
-
JOBAGENT
The item is aJobAgent
-
JOBAGENTSETTINGS
The item is aJobAgentSettings
-
EXPERIMENT
The item is anExperiment
-
BIOASSAYSET
The item is aBioAssaySet
-
BIOASSAY
The item is aBioAssay
-
TRANSFORMATION
The item is aTransformation
-
EXTRAVALUETYPE
The item is anExtraValueType
-
EXTRAVALUE
The item is anExtraValue
-
FORMULA
The item is aFormula
-
SPOTDATA
Representing spot data, not an actual item. -
VIRTUALDB
The item is aVirtualDb
-
DATACUBE
The item is aDataCube
-
DATACUBELAYER
The item is aDataCubeLayer
-
DATACUBECOLUMN
The item is aDataCubeColumn
-
DATACUBEFILTER
The item is aDataCubeFilter
-
DATACUBEEXTRAVALUE
The item is aDataCubeExtraValue
-
PLATFORM
The item is aPlatform
-
PLATFORMVARIANT
The item is aPlatformVariant
-
PLATFORMFILETYPE
The item is aPlatformFileType
-
FILESET
The item is aFileSet
-
FILESETMEMBER
The item is aFileSetMember
-
DATAFILETYPE
The item is aDataFileType
-
-
Field Details
-
MAX_VALUE
static int MAX_VALUE -
valueMapping
-
aliasMapping
-
itemClassMapping
-
dataClassMapping
-
value
private final int value -
displayValue
-
alias
-
itemClass
-
dataClass
-
definedPermissions
-
getById
-
getQuery
-
constructor
-
deletionOrder
private final float deletionOrder -
DELETION_ORDER
-
-
Constructor Details
-
Item
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
-
getValue
public int getValue()Get the integer value that is used when storing an item to the database. -
getAlias
Get the alias for this item, which is used in queries,- See Also:
-
isBasicItem
public boolean isBasicItem()Is this item representing a BasicItem object or not? Some items only have data-layer representation and require special handling.- Since:
- 3.2
-
getItemClass
Get the class object that is used to handle items of this type. -
getDataClass
Get the data object that is used to store information in the database for items of this type. -
getDefinedPermissions
Get the permissions which are meaningful to assign to an item if this type. This is not used internally by the core, but is can be used by client applications to dynamically display a proper input form while assigning permissions.- Returns:
- A
Set
containing the permissions
-
getDeletionOrder
public float getDeletionOrder()Get a value indicating the deletion order. Items with a low value should be deleted before items with a high value, to minimize the risk that theBasicItem.isUsed()
method returns true.- Returns:
- The deletion order value
- Since:
- 2.4
-
getById
public <T extends BasicItem> T getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get the item of the type represented by this enumeration constant with the specified id. Ie.Item.SAMPLE.getById()
is the same asSample.getById
.- Parameters:
dc
- TheDbControl
object used for database access and permission checkingid
- The id of the item- Returns:
- An item of the type represented by this enumeration constant
- Throws:
ItemNotFoundException
- If an item with the specified id isn't foundPermissionDeniedException
- If the logged in user hasn't read permission for the itemBaseException
- If there is another error
-
supportsGetQuery
public boolean supportsGetQuery()Check ifgetQuery()
is supported by this item type.- Since:
- 3.5
-
getQuery
Get a query returning items of this type. This method is supported by items that declare a static parameterlessgetQuery()
method in their item class (eg.Sample.getQuery()
.- Since:
- 3.5
-
getConstructor
Get the default constructor for new objects of this type. The default constructor is a constructor that takes aBasicData
object as the only parameter. For exampleSample(SampleData data)
.- Returns:
- The constructor, or null if no such constructor exists
- See Also:
-
fromValue
Get theItem
object when you know the integer code.- Parameters:
value
- Integer code- Returns:
- an Item enumeration.
-
fromItemClass
Get theItem
object when you know the item class.- Parameters:
itemClass
- Item class for whichItem
object should be returned- Returns:
- an Item enumeration.
-
fromDataClass
Get theItem
object when you know the data class.- Parameters:
dataClass
- Data class for which the Item should be returned.- Returns:
- an Item enumeration.
-
fromClass
Get theItem
object when you know either the item or data class.- Parameters:
anyClass
- The class to get correspondingItem
for.- Returns:
- The Item object, or null if no matching item is found
-
fromDataObject
Get theItem
object when you have a data layer object. This method takes Hibernate proxies into account.- Parameters:
data
- The data layer object for which correspondingItem
should be returned.- Returns:
- The Item object, or null if no matching item is found.
-