Enum AccessType
- java.lang.Object
-
- java.lang.Enum<AccessType>
-
- org.gcube.informationsystem.base.reference.AccessType
-
- All Implemented Interfaces:
Serializable,Comparable<AccessType>
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 Summary
Enum Constants Enum Constant Description CONSISTS_OFRepresents a composition relationship, where one resource is part of another.CONTEXTRepresents a hierarchical context for organizing resources.ENTITYRepresents a generic entity instance.ENTITY_ELEMENTRepresents an entity element, the base for all entity types.ENTITY_TYPERepresents the type of an entity, defining its structure and attributes.FACETRepresents a facet, which adds supplementary information to a resource.IS_PARENT_OFRepresents a parent-child relationship between contexts.IS_RELATED_TORepresents a relationship between two resources.PROPERTYRepresents a generic property instance.PROPERTY_DEFINITIONRepresents the definition of a property, including constraints and metadata.PROPERTY_ELEMENTRepresents a property element, the base for all property types.PROPERTY_TYPERepresents the type of a property, defining its data type and structure.QUERY_TEMPLATERepresents a template for constructing queries.RELATIONRepresents a generic relation instance.RELATION_ELEMENTRepresents a relation element, the base for all relation types.RELATION_TYPERepresents the type of a relation, defining its semantics and constraints.RESOURCERepresents a primary resource in the system.TEMPLATE_VARIABLERepresents a variable used within a query template.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AccessTypegetAccessType(Class<?> clz)Determines the most specificAccessTypefor a given class.static AccessTypegetAccessType(String typeName)Retrieves anAccessTypeenum constant by its type name.<ISM extends Element,ISMC extends ISM,ISMD extends ISMC>
Class<ISMD>getDummyImplementationClass()Returns the dummy implementation class for this access type, if one exists.static AccessType[]getERTypes()Returns an array of access types representing entities and relations in the model.<ISM extends Element,ISMC extends ISM>
Class<ISMC>getImplementationClass()Returns the primary implementation class for this access type.static AccessType[]getModelTypes()Returns an array of access types that are part of the core data model.StringgetName()Returns the official name of the access type.<ISM extends Element>
Class<ISM>getTypeClass()Returns the interface class associated with this access type.StringlowerCaseFirstCharacter()Returns the name of the access type with its first character in lowercase.static Set<String>names()Returns a set of all defined access type names.StringtoString()static AccessTypevalueOf(String name)Returns the enum constant of this type with the specified name.static AccessType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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.
-
IS_RELATED_TO
public static final AccessType IS_RELATED_TO
Represents a relationship between two resources.
-
CONSISTS_OF
public static final AccessType CONSISTS_OF
Represents a composition relationship, where one resource is part of another.
-
-
Method Detail
-
values
public static AccessType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AccessType c : AccessType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AccessType valueOf(String name)
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
-
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
Classof 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
Classof 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
Classof the dummy implementation, ornull.
-
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:
toStringin classEnum<AccessType>
-
names
public static Set<String> names()
Returns a set of all defined access type names.- Returns:
- A
Setof type names.
-
getAccessType
public static AccessType getAccessType(String typeName)
Retrieves anAccessTypeenum constant by its type name.- Parameters:
typeName- The name of the type to find.- Returns:
- The corresponding
AccessType, ornullif no match is found.
-
getAccessType
public static AccessType getAccessType(Class<?> clz)
Determines the most specificAccessTypefor 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
AccessTypefor 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, andConsistsOf.- 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, andConsistsOf.- Returns:
- An array of entity/relation
AccessTypes.
-
-