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
A type definition describes the structure of an element, including its name, version, properties, and inheritance relationships.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property name for the 'abstract' flag.static final StringThe property name for the type's changelog.static final StringThe property name for the type's description.static final StringThe property name for the set of extended types.static final StringThe property name for the 'final' flag.static final StringThe property name for the 'locked' flag.static final StringThe name of the base Type.static final StringThe property name for the type's name.static final StringThe property name for the set of property definitions.static final StringThe property name for the type's version.Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, REDACTED, TYPE_PROPERTY, UNKNOWN_USERFields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY -
Method Summary
Modifier and TypeMethodDescriptionReturns theAccessTypeof this type definition.Returns the map of any additional, dynamic properties.Returns the changelog for this type.Returns the changelog with versions represented as strings.Returns the description of the type.Returns the types that this type extends.getID()Returns the unique identifier (UUID) of the element.Returns the metadata associated with the element.getName()Returns the name of the type.Returns the properties defined by this type.Returns the version of the type.Returns the version of the type as a string.booleanChecks 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.voidSets 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 Details
-
NAME
The name of the base Type.- See Also:
-
NAME_PROPERTY
The property name for the type's name.- See Also:
-
DESCRIPTION_PROPERTY
The property name for the type's description.- See Also:
-
VERSION_PROPERTY
The property name for the type's version.- See Also:
-
CHANGELOG_PROPERTY
The property name for the type's changelog.- See Also:
-
ABSTRACT_PROPERTY
The property name for the 'abstract' flag.- See Also:
-
FINAL_PROPERTY
The property name for the 'final' flag.- See Also:
-
LOCKED_PROPERTY
The property name for the 'locked' flag.- See Also:
-
EXTENDED_TYPES_PROPERTY
The property name for the set of extended types.- See Also:
-
PROPERTIES_PROPERTY
The property name for the set of property definitions.- See Also:
-
-
Method Details
-
getID
UUID getID()Returns the unique identifier (UUID) of the element.- Specified by:
getIDin interfaceIdentifiableElement- Returns:
- The
UUIDof the element.
-
setID
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
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
Returns the changelog for this type.- Returns:
- A map of versions to change descriptions.
-
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
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
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
Returns the map of any additional, dynamic properties.- Returns:
- The map of additional properties.
-
setAdditionalProperty
Sets an additional dynamic property.- Parameters:
name- the property namevalue- the property value
-