Enum Class AccessType

java.lang.Object
java.lang.Enum<AccessType>
org.gcube.informationsystem.base.reference.AccessType
All Implemented Interfaces:
Serializable, Comparable<AccessType>, Constable

public enum AccessType extends Enum<AccessType>
Enumerates the fundamental types of elements within the Information System model.

This enum serves as a central registry for all element types, mapping them to their corresponding interface, implementation, and (where applicable) dummy implementation classes. It provides utility methods for type lookup and classification.

Author:
Luca Frosini (ISTI - CNR)
  • Enum Constant Details

    • PROPERTY_ELEMENT

      public static final AccessType PROPERTY_ELEMENT
      Represents a property element, the base for all property types.
    • PROPERTY_DEFINITION

      public static final AccessType PROPERTY_DEFINITION
      Represents the definition of a property, including constraints and metadata.
    • PROPERTY_TYPE

      public static final AccessType PROPERTY_TYPE
      Represents the type of a property, defining its data type and structure.
    • TEMPLATE_VARIABLE

      public static final AccessType TEMPLATE_VARIABLE
      Represents a variable used within a query template.
    • PROPERTY

      public static final AccessType PROPERTY
      Represents a generic property instance.
    • ENTITY_ELEMENT

      public static final AccessType ENTITY_ELEMENT
      Represents an entity element, the base for all entity types.
    • ENTITY_TYPE

      public static final AccessType ENTITY_TYPE
      Represents the type of an entity, defining its structure and attributes.
    • QUERY_TEMPLATE

      public static final AccessType QUERY_TEMPLATE
      Represents a template for constructing queries.
    • CONTEXT

      public static final AccessType CONTEXT
      Represents a hierarchical context for organizing resources.
    • ENTITY

      public static final AccessType ENTITY
      Represents a generic entity instance.
    • RESOURCE

      public static final AccessType RESOURCE
      Represents a primary resource in the system.
    • FACET

      public static final AccessType FACET
      Represents a facet, which adds supplementary information to a resource.
    • RELATION_ELEMENT

      public static final AccessType RELATION_ELEMENT
      Represents a relation element, the base for all relation types.
    • RELATION_TYPE

      public static final AccessType RELATION_TYPE
      Represents the type of a relation, defining its semantics and constraints.
    • IS_PARENT_OF

      public static final AccessType IS_PARENT_OF
      Represents a parent-child relationship between contexts.
    • RELATION

      public static final AccessType RELATION
      Represents a generic relation instance.
    • CONSISTS_OF

      public static final AccessType CONSISTS_OF
      Represents a composition relationship, where one resource is part of another.
  • Method Details

    • values

      public static AccessType[] 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 AccessType 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
    • getTypeClass

      public <ISM extends Element> Class<ISM> getTypeClass()
      Returns the interface class associated with this access type.
      Type Parameters:
      ISM - The element type.
      Returns:
      The Class of the element's interface.
    • getImplementationClass

      public <ISM extends Element, ISMC extends ISM> Class<ISMC> getImplementationClass()
      Returns the primary implementation class for this access type.
      Type Parameters:
      ISM - The element type.
      ISMC - The element's implementation type.
      Returns:
      The Class of the primary implementation.
    • getDummyImplementationClass

      public <ISM extends Element, ISMC extends ISM, ISMD extends ISMC> Class<ISMD> getDummyImplementationClass()
      Returns the dummy implementation class for this access type, if one exists.

      Dummy implementations are used for lightweight representations or placeholders.

      Type Parameters:
      ISM - The element type.
      ISMC - The element's implementation type.
      ISMD - The element's dummy implementation type.
      Returns:
      The Class of the dummy implementation, or null.
    • getName

      public String getName()
      Returns the official name of the access type.
      Returns:
      The type name.
    • lowerCaseFirstCharacter

      public String lowerCaseFirstCharacter()
      Returns the name of the access type with its first character in lowercase.
      Returns:
      The name with a lowercase first character.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<AccessType>
    • names

      public static Set<String> names()
      Returns a set of all defined access type names.
      Returns:
      A Set of type names.
    • getAccessType

      public static AccessType getAccessType(String typeName)
      Retrieves an AccessType enum constant by its type name.
      Parameters:
      typeName - The name of the type to find.
      Returns:
      The corresponding AccessType, or null if no match is found.
    • getAccessType

      public static AccessType getAccessType(Class<?> clz)
      Determines the most specific AccessType for a given class.

      This method traverses the class hierarchy to find the most derived matching access type.

      Parameters:
      clz - The class to analyze.
      Returns:
      The most specific AccessType for the class.
      Throws:
      RuntimeException - if the class does not correspond to any defined access type.
    • getModelTypes

      public static AccessType[] getModelTypes()
      Returns an array of access types that are part of the core data model.

      These types include Property, Resource, Facet, IsRelatedTo, and ConsistsOf.

      Returns:
      An array of core model AccessTypes.
    • getERTypes

      public static AccessType[] getERTypes()
      Returns an array of access types representing entities and relations in the model.

      These types include Resource, Facet, IsRelatedTo, and ConsistsOf.

      Returns:
      An array of entity/relation AccessTypes.