Interface Type
-
- All Superinterfaces:
Element,IdentifiableElement,Serializable
- All Known Subinterfaces:
ConsistsOfSchema,EntitySchema,FacetSchema,IsRelatedToSchema,PropertySchema,RelationSchema<S,T>,ResourceSchema
- All Known Implementing Classes:
ConsistsOfSchemaImpl,EntitySchemaImpl,FacetSchemaImpl,IsRelatedToSchemaImpl,PropertySchemaImpl,RelationSchemaImpl,ResourceSchemaImpl,TypeImpl
@TypeMetadata(name="Type", description="The base type for all type definitions in the Information System model; a type definition describes the structure of an element, including its name, version, properties, and inheritance relationships.", version="1.0.0") @Change(version="1.0.0", description="First Version") public interface Type extends IdentifiableElement
The base interface for all type definitions in the Information System model.A type definition describes the structure of an element, including its name, version, properties, and inheritance relationships.
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringABSTRACT_PROPERTYThe property name for the 'abstract' flag.static StringCHANGELOG_PROPERTYThe property name for the type's changelog.static StringDESCRIPTION_PROPERTYThe property name for the type's description.static StringEXTENDED_TYPES_PROPERTYThe property name for the set of extended types.static StringFINAL_PROPERTYThe property name for the 'final' flag.static StringLOCKED_PROPERTYThe property name for the 'locked' flag.static StringNAMEThe name of the base Type.static StringNAME_PROPERTYThe property name for the type's name.static StringNAME_REGEXThe grammar of a Type name: UpperCamelCase, an initial capital letter followed by letters and digits only.static StringPROPERTIES_PROPERTYThe property name for the set of property definitions.static StringVERSION_PROPERTYThe property name for the type's version.-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, REDACTED, TYPE_PROPERTY, UNKNOWN_USER
-
Fields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AccessTypegetAccessType()Returns theAccessTypeof this type definition.Map<String,Object>getAdditionalProperties()Returns the map of any additional, dynamic properties.Map<Version,String>getChangelog()Returns the changelog for this type.Map<String,String>getChangelogWithVersionAsString()Returns the changelog with versions represented as strings.StringgetDescription()Returns the description of the type.List<String>getExtendedTypes()Returns the types that this type extends.UUIDgetID()Returns the unique identifier (UUID) of the element.MetadatagetMetadata()Returns the metadata associated with the element.StringgetName()Returns the name of the type.List<PropertyDefinition>getProperties()Returns the properties defined by this type.VersiongetVersion()Returns the version of the type.StringgetVersionAsString()Returns the version of the type as a string.booleanisAbstract()Checks if the type is abstract.booleanisFinal()Checks if the type is final.booleanisLocked()Checks whether this type's own definition is protected from modification and deletion through the Type write API.voidsetAdditionalProperty(String name, Object value)Sets an additional dynamic property.voidsetExtendedTypes(List<String> extendedTypes)Sets the types that this type extends, preserving their declaration order.voidsetID(UUID uuid)Sets the unique identifier (UUID) for the element.voidsetLocked(boolean locked)Sets whether this type's own definition is protected from modification and deletion.voidsetMetadata(Metadata metadata)Sets the metadata for the element.-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the base Type.- See Also:
- Constant Field Values
-
NAME_REGEX
static final String NAME_REGEX
The grammar of a Type name: UpperCamelCase, an initial capital letter followed by letters and digits only.- See Also:
- Constant Field Values
-
NAME_PROPERTY
static final String NAME_PROPERTY
The property name for the type's name.- See Also:
- Constant Field Values
-
DESCRIPTION_PROPERTY
static final String DESCRIPTION_PROPERTY
The property name for the type's description.- See Also:
- Constant Field Values
-
VERSION_PROPERTY
static final String VERSION_PROPERTY
The property name for the type's version.- See Also:
- Constant Field Values
-
CHANGELOG_PROPERTY
static final String CHANGELOG_PROPERTY
The property name for the type's changelog.- See Also:
- Constant Field Values
-
ABSTRACT_PROPERTY
static final String ABSTRACT_PROPERTY
The property name for the 'abstract' flag.- See Also:
- Constant Field Values
-
FINAL_PROPERTY
static final String FINAL_PROPERTY
The property name for the 'final' flag.- See Also:
- Constant Field Values
-
LOCKED_PROPERTY
static final String LOCKED_PROPERTY
The property name for the 'locked' flag.- See Also:
- Constant Field Values
-
EXTENDED_TYPES_PROPERTY
static final String EXTENDED_TYPES_PROPERTY
The property name for the set of extended types.- See Also:
- Constant Field Values
-
PROPERTIES_PROPERTY
static final String PROPERTIES_PROPERTY
The property name for the set of property definitions.- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
UUID getID()
Returns the unique identifier (UUID) of the element.- Specified by:
getIDin interfaceIdentifiableElement- Returns:
- The
UUIDof the element.
-
setID
void setID(UUID uuid)
Sets the unique identifier (UUID) for the element.- Specified by:
setIDin interfaceIdentifiableElement- Parameters:
uuid- TheUUIDto set.
-
getMetadata
Metadata getMetadata()
Returns the metadata associated with the element.The metadata is included in JSON serialization only if it is not null.
- Specified by:
getMetadatain interfaceIdentifiableElement- Returns:
- The
Metadataof the element, ornullif none is set.
-
setMetadata
void setMetadata(Metadata metadata)
Sets the metadata for the element.- Specified by:
setMetadatain interfaceIdentifiableElement- Parameters:
metadata- TheMetadatato associate with the element.
-
getName
String getName()
Returns the name of the type.- Returns:
- The type name.
-
getDescription
String getDescription()
Returns the description of the type.- Returns:
- The type description.
-
getVersion
Version getVersion()
Returns the version of the type.- Returns:
- The type version.
-
getVersionAsString
String getVersionAsString()
Returns the version of the type as a string.- Returns:
- The version string.
-
getChangelog
Map<Version,String> getChangelog()
Returns the changelog for this type.- Returns:
- A map of versions to change descriptions.
-
getChangelogWithVersionAsString
Map<String,String> getChangelogWithVersionAsString()
Returns the changelog with versions represented as strings.- Returns:
- A map of version strings to change descriptions.
-
isAbstract
boolean isAbstract()
Checks if the type is abstract.- Returns:
trueif the type is abstract,falseotherwise.
-
isFinal
boolean isFinal()
Checks if the type is final.- Returns:
trueif the type is final,falseotherwise.
-
isLocked
boolean isLocked()
Checks whether this type's own definition is protected from modification and deletion through the Type write API.Server-assigned and never accepted from a client: a value submitted in a write payload is silently ignored, exactly as
metadataalready is, and the response reports the real value. It istrueexactly for the types intrinsic toinformation-system-modelitself, andfalsefor every other type, including those contributed by a domain model on the classpath.- Returns:
trueif the type definition is locked,falseotherwise.
-
setLocked
void setLocked(boolean locked)
Sets whether this type's own definition is protected from modification and deletion.- Parameters:
locked-trueto mark the type definition as locked,falseotherwise.
-
getExtendedTypes
List<String> getExtendedTypes()
Returns the types that this type extends.A
Listbecause the order carries meaning: it is the declaration order of the direct parents -- the local precedence order C3 linearization requires -- and it must survive serialization and persistence unchanged. ASetwould map to an unordered store and lose it.- Returns:
- The parent type names, in declaration order.
-
setExtendedTypes
void setExtendedTypes(List<String> extendedTypes)
Sets the types that this type extends, preserving their declaration order.- Parameters:
extendedTypes- the parent type names, in declaration order.
-
getProperties
List<PropertyDefinition> getProperties()
Returns the properties defined by this type.A
Listbecause the order carries meaning: properties are read in the order the Java class declares them, which is the intended reading order for anyone looking at the type definition. ASetwould map to an unordered store and lose it.- Returns:
- The
PropertyDefinitions, in declaration order.
-
getAccessType
AccessType getAccessType()
Returns theAccessTypeof this type definition.- Returns:
- The access type.
-
getAdditionalProperties
Map<String,Object> getAdditionalProperties()
Returns the map of any additional, dynamic properties.- Returns:
- The map of additional properties.
-
-