Package net.sf.basedb.core
Enum Item
- All Implemented Interfaces:
Serializable
,Comparable<Item>
,java.lang.constant.Constable
public enum Item extends Enum<Item>
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
Nested Classes Modifier and Type Class Description private static class
Item.DefinedPermissions
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
-
Field Summary
Fields Modifier and Type Field Description private String
alias
private static Map<String,Item>
aliasMapping
private Constructor<? extends BasicItem>
constructor
private Class<? extends BasicData>
dataClass
private static Map<Class<? extends BasicData>,Item>
dataClassMapping
private Set<Permission>
definedPermissions
static Comparator<Identifiable>
DELETION_ORDER
private float
deletionOrder
private String
displayValue
private Method
getById
private Method
getQuery
private Class<? extends BasicItem>
itemClass
private static Map<Class<? extends BasicItem>,Item>
itemClassMapping
(package private) static int
MAX_VALUE
private int
value
private static Map<Integer,Item>
valueMapping
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description static Item
fromClass(Class<?> anyClass)
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.String
getAlias()
Get the alias for this item, which is used in queries,<T extends BasicItem>
TgetById(DbControl dc, int id)
Get the item of the type represented by this enumeration constant with the specified id.(package private) <T extends BasicItem>
Constructor<T>getConstructor()
Get the default constructor for new objects of this type.Class<? extends BasicData>
getDataClass()
Get the data object that is used to store information in the database for items of this type.Set<Permission>
getDefinedPermissions()
Get the permissions which are meaningful to assign to an item if this type.float
getDeletionOrder()
Get a value indicating the deletion order.Class<? extends BasicItem>
getItemClass()
Get the class object that is used to handle items of this type.<T extends BasicItem>
ItemQuery<T>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
isBasicItem()
Is this item representing a BasicItem object or not?boolean
supportsGetQuery()
Check ifgetQuery()
is supported by this item type.String
toString()
static Item
valueOf(String name)
Returns the enum constant of this type with the specified name.static Item[]
values()
Returns an array containing the constants of this enum type, 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 type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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:
Query.getRootAlias()
-
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, BaseExceptionGet 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:
DbControl.getItem(Class, BasicData, Object[])
-
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.
-