Enum Class Item

java.lang.Object
java.lang.Enum<Item>
net.sf.basedb.core.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) $
  • Enum Constant Details

    • SYSTEM

      public static final Item SYSTEM
      Not an item as susch. Used for setting system permissions to role keys.
      See Also:
    • USER

      public static final Item USER
      The item is a User.
    • GROUP

      public static final Item GROUP
      The item is a Group.
    • ROLE

      public static final Item ROLE
      The item is a Role.
    • PROJECT

      public static final Item PROJECT
      The item is a Project.
    • ITEMKEY

      public static final Item ITEMKEY
      The item is an ItemKey.
    • PROJECTKEY

      public static final Item PROJECTKEY
      The item is a ProjectKey.
    • ROLEKEY

      public static final Item ROLEKEY
      The item is a RoleKey.
    • PERMISSIONTEMPLATE

      public static final Item PERMISSIONTEMPLATE
      The item is a PermissionTemplate.
    • CLIENT

      public static final Item CLIENT
      The item is an Client.
    • HELP

      public static final Item HELP
      The item is a Help.
    • SESSION

      public static final Item SESSION
      The item is an Session.
    • SETTING

      public static final Item SETTING
      The item is an Setting.
    • GLOBALDEFAULTSETTING

      public static final Item GLOBALDEFAULTSETTING
      The item is an GlobalDefaultSetting.
    • USERDEFAULTSETTING

      public static final Item USERDEFAULTSETTING
      The item is an UserDefaultSetting.
    • CLIENTDEFAULTSETTING

      public static final Item CLIENTDEFAULTSETTING
      The item is an ClientDefaultSetting.
    • USERCLIENTSETTING

      public static final Item USERCLIENTSETTING
      The item is an UserClientSetting.
    • USERDEVICE

      public static final Item USERDEVICE
      The item is an UserDevice.
    • QUOTA

      public static final Item QUOTA
      The item is a Quota.
    • QUOTATYPE

      public static final Item QUOTATYPE
      The item is a QuotaType.
    • DISKUSAGE

      public static final Item DISKUSAGE
      The item is a DiskUsage.
    • FILE

      public static final Item FILE
      The item is a File.
    • DIRECTORY

      public static final Item DIRECTORY
      The item is a Directory.
    • MIMETYPE

      public static final Item MIMETYPE
      The item is a MimeType.
    • FILESERVER

      public static final Item FILESERVER
      The item is a FileServer.
    • PROTOCOL

      public static final Item PROTOCOL
      The item is a Protocol.
    • HARDWARE

      public static final Item HARDWARE
      The item is a Hardware.
    • SOFTWARE

      public static final Item SOFTWARE
      The item is a Software.
    • KIT

      public static final Item KIT
      The item is a Kit.
      Since:
      3.7
    • NEWS

      public static final Item NEWS
      The item is a News.
    • MESSAGE

      public static final Item MESSAGE
      The item is a Message.
    • ANYTOANY

      public static final Item ANYTOANY
      The item is an AnyToAny link.
    • ITEMLIST

      public static final Item ITEMLIST
      The item is an ItemList
    • SYNCFILTER

      public static final Item SYNCFILTER
      The item is a SyncFilter
    • CHANGEHISTORY

      public static final Item CHANGEHISTORY
      The item is a ChangeHistory entry.
    • CHANGEHISTORY_VALUES

      public static final Item CHANGEHISTORY_VALUES
      Virtual item representing the new and old values column in ChangeHistory which need special access permissions.
    • ITEMSUBTYPE

      public static final Item ITEMSUBTYPE
      The item is a ItemSubtype.
    • ITEMSUBTYPEFILETYPE

      public static final Item ITEMSUBTYPEFILETYPE
      The item is a ItemSubtypeFileType
    • REPORTER

      public static final Item REPORTER
      The item is a Reporter.
    • REPORTERTYPE

      public static final Item REPORTERTYPE
      The item is a ReporterType.
    • REPORTERLIST

      public static final Item REPORTERLIST
      The item is a ReporterType.
    • REPORTERSCORE

      public static final Item REPORTERSCORE
      The item is a ReporterScore. This item is not a BasicItem.
    • REPORTERCLONETEMPLATE

      public static final Item REPORTERCLONETEMPLATE
      The item is a ReporterCloneTemplate.
      Since:
      3.1
    • ANNOTATIONSET

      public static final Item ANNOTATIONSET
      The item is an AnnotationSet.
    • ANNOTATION

      public static final Item ANNOTATION
      The item is an Annotation.
    • ANNOTATIONTYPE

      public static final Item ANNOTATIONTYPE
      The item is an AnnotationType.
    • ANNOTATIONTYPECATEGORY

      public static final Item ANNOTATIONTYPECATEGORY
      The item is an AnnotationTypeCategory.
    • QUANTITY

      public static final Item QUANTITY
      The item is a Quantity.
    • UNIT

      public static final Item UNIT
      The item is a Unit.
    • BIOSOURCE

      public static final Item BIOSOURCE
      The item is a BioSource.
    • SAMPLE

      public static final Item SAMPLE
      The item is a Sample.
    • EXTRACT

      public static final Item EXTRACT
      The item is an Extract.
    • BIOMATERIALEVENT

      public static final Item BIOMATERIALEVENT
      The item is a BioMaterialEvent.
    • TAG

      public static final Item TAG
      The item is a Tag.
    • BIOPLATE

      public static final Item BIOPLATE
      The item is a BioPlate
    • BIOWELL

      public static final Item BIOWELL
      The item is a BioWell
    • BIOPLATETYPE

      public static final Item BIOPLATETYPE
      The item is a BioPlateType.
      Since:
      2.16
    • BIOPLATEEVENT

      public static final Item BIOPLATEEVENT
      The item is a BioPlateEvent
      Since:
      2.17
    • BIOPLATEEVENTPARTICIPANT

      public static final Item BIOPLATEEVENTPARTICIPANT
      Since:
      2.17
    • BIOPLATEEVENTTYPE

      public static final Item BIOPLATEEVENTTYPE
      The item is a BioPlateEventType
      Since:
      2.17
    • PLATEGEOMETRY

      public static final Item PLATEGEOMETRY
      The item is a PlateGeometry.
    • PLATE

      public static final Item PLATE
      The item is a Plate.
    • PLATETYPE

      public static final Item PLATETYPE
      The item is a PlateType.
    • PLATEEVENT

      public static final Item PLATEEVENT
      The item is a PlateEvent.
    • PLATEEVENTTYPE

      public static final Item PLATEEVENTTYPE
      The item is a PlateEventType.
    • WELL

      public static final Item WELL
      The item is a Well.
    • PLATEMAPPING

      public static final Item PLATEMAPPING
      The item is a PlateMapping.
    • ARRAYDESIGN

      public static final Item ARRAYDESIGN
      The item is an ArrayDesign.
    • ARRAYBATCH

      public static final Item ARRAYBATCH
      The item is an ArrayBatch.
    • ARRAYSLIDE

      public static final Item ARRAYSLIDE
      The item is an ArraySlide.
    • ARRAYDESIGNBLOCK

      public static final Item ARRAYDESIGNBLOCK
      The item is an ArrayDesignBlock.
    • FEATURE

      public static final Item FEATURE
      The item is a Feature.
    • ARRAYDESIGNPLATE

      public static final Item ARRAYDESIGNPLATE
      The item is a ArrayDesignPlate connecter.
    • PHYSICALBIOASSAY

      public static final Item PHYSICALBIOASSAY
      The item is a PhysicalBioAssay.
    • DERIVEDBIOASSAY

      public static final Item DERIVEDBIOASSAY
      The item is a DerivedBioAssay.
    • RAWBIOASSAY

      public static final Item RAWBIOASSAY
      The item is a RawBioAssay.
    • ROOTRAWBIOASSAY

      public static final Item ROOTRAWBIOASSAY
      The item is a RootRawBioAssay.
      Since:
      3.6
    • RAWDATA

      public static final Item RAWDATA
      The item is a RawData spot.
    • PLUGINTYPE

      public static final Item PLUGINTYPE
      The item is a PluginType
    • PLUGINDEFINITION

      public static final Item PLUGINDEFINITION
      The item is a PluginDefinition
    • PLUGINCONFIGURATION

      public static final Item PLUGINCONFIGURATION
      The item is a PluginConfiguration
    • JOB

      public static final Item JOB
      The item is a Job
    • JOBAGENT

      public static final Item JOBAGENT
      The item is a JobAgent
    • JOBAGENTSETTINGS

      public static final Item JOBAGENTSETTINGS
      The item is a JobAgentSettings
    • EXPERIMENT

      public static final Item EXPERIMENT
      The item is an Experiment
    • BIOASSAYSET

      public static final Item BIOASSAYSET
      The item is a BioAssaySet
    • BIOASSAY

      public static final Item BIOASSAY
      The item is a BioAssay
    • TRANSFORMATION

      public static final Item TRANSFORMATION
      The item is a Transformation
    • EXTRAVALUETYPE

      public static final Item EXTRAVALUETYPE
      The item is an ExtraValueType
    • EXTRAVALUE

      public static final Item EXTRAVALUE
      The item is an ExtraValue
    • FORMULA

      public static final Item FORMULA
      The item is a Formula
    • SPOTDATA

      public static final Item SPOTDATA
      Representing spot data, not an actual item.
    • VIRTUALDB

      public static final Item VIRTUALDB
      The item is a VirtualDb
    • DATACUBE

      public static final Item DATACUBE
      The item is a DataCube
    • DATACUBELAYER

      public static final Item DATACUBELAYER
      The item is a DataCubeLayer
    • DATACUBECOLUMN

      public static final Item DATACUBECOLUMN
      The item is a DataCubeColumn
    • DATACUBEFILTER

      public static final Item DATACUBEFILTER
      The item is a DataCubeFilter
    • DATACUBEEXTRAVALUE

      public static final Item DATACUBEEXTRAVALUE
      The item is a DataCubeExtraValue
    • PLATFORM

      public static final Item PLATFORM
      The item is a Platform
    • PLATFORMVARIANT

      public static final Item PLATFORMVARIANT
      The item is a PlatformVariant
    • PLATFORMFILETYPE

      public static final Item PLATFORMFILETYPE
      The item is a PlatformFileType
    • FILESET

      public static final Item FILESET
      The item is a FileSet
    • FILESETMEMBER

      public static final Item FILESETMEMBER
      The item is a FileSetMember
    • DATAFILETYPE

      public static final Item DATAFILETYPE
      The item is a DataFileType
  • Field Details

    • MAX_VALUE

      static int MAX_VALUE
    • valueMapping

      private static final Map<Integer,Item> valueMapping
    • aliasMapping

      private static final Map<String,Item> aliasMapping
    • itemClassMapping

      private static final Map<Class<? extends BasicItem>,Item> itemClassMapping
    • dataClassMapping

      private static final Map<Class<? extends BasicData>,Item> dataClassMapping
    • value

      private final int value
    • displayValue

      private final String displayValue
    • alias

      private final String alias
    • itemClass

      private final Class<? extends BasicItem> itemClass
    • dataClass

      private final Class<? extends BasicData> dataClass
    • definedPermissions

      private final Set<Permission> definedPermissions
    • getById

      private final transient Method getById
    • getQuery

      private final transient Method getQuery
    • constructor

      private final transient Constructor<? extends BasicItem> constructor
    • deletionOrder

      private final float deletionOrder
    • DELETION_ORDER

      public static final Comparator<Identifiable> DELETION_ORDER
  • Constructor Details

  • Method Details

    • values

      public static Item[] 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

      public static Item valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Item>
    • getValue

      public int getValue()
      Get the integer value that is used when storing an item to the database.
    • getAlias

      public String 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

      public Class<? extends BasicItem> getItemClass()
      Get the class object that is used to handle items of this type.
    • getDataClass

      public Class<? extends BasicData> getDataClass()
      Get the data object that is used to store information in the database for items of this type.
    • getDefinedPermissions

      public Set<Permission> 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 the BasicItem.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 as Sample.getById.
      Parameters:
      dc - The DbControl object used for database access and permission checking
      id - 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 found
      PermissionDeniedException - If the logged in user hasn't read permission for the item
      BaseException - If there is another error
    • supportsGetQuery

      public boolean supportsGetQuery()
      Check if getQuery() is supported by this item type.
      Since:
      3.5
    • getQuery

      public <T extends BasicItem> ItemQuery<T> getQuery()
      Get a query returning items of this type. This method is supported by items that declare a static parameterless getQuery() method in their item class (eg. Sample.getQuery().
      Since:
      3.5
    • getConstructor

      <T extends BasicItem> Constructor<T> getConstructor()
      Get the default constructor for new objects of this type. The default constructor is a constructor that takes a BasicData object as the only parameter. For example Sample(SampleData data).
      Returns:
      The constructor, or null if no such constructor exists
      See Also:
    • fromValue

      public static Item fromValue(int value)
      Get the Item object when you know the integer code.
      Parameters:
      value - Integer code
      Returns:
      an Item enumeration.
    • fromItemClass

      public static Item fromItemClass(Class<? extends BasicItem> itemClass)
      Get the Item object when you know the item class.
      Parameters:
      itemClass - Item class for which Item object should be returned
      Returns:
      an Item enumeration.
    • fromDataClass

      public static Item fromDataClass(Class<? extends BasicData> dataClass)
      Get the Item object when you know the data class.
      Parameters:
      dataClass - Data class for which the Item should be returned.
      Returns:
      an Item enumeration.
    • fromClass

      public static Item fromClass(Class<?> anyClass)
      Get the Item object when you know either the item or data class.
      Parameters:
      anyClass - The class to get corresponding Item for.
      Returns:
      The Item object, or null if no matching item is found
    • fromDataObject

      public static Item fromDataObject(BasicData data)
      Get the Item object when you have a data layer object. This method takes Hibernate proxies into account.
      Parameters:
      data - The data layer object for which corresponding Item should be returned.
      Returns:
      The Item object, or null if no matching item is found.