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 Details

    • NAME

      static final String NAME
      The name of the base Type.
      See Also:
    • 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:
    • NAME_PROPERTY

      static final String NAME_PROPERTY
      The property name for the type's name.
      See Also:
    • DESCRIPTION_PROPERTY

      static final String DESCRIPTION_PROPERTY
      The property name for the type's description.
      See Also:
    • VERSION_PROPERTY

      static final String VERSION_PROPERTY
      The property name for the type's version.
      See Also:
    • CHANGELOG_PROPERTY

      static final String CHANGELOG_PROPERTY
      The property name for the type's changelog.
      See Also:
    • ABSTRACT_PROPERTY

      static final String ABSTRACT_PROPERTY
      The property name for the 'abstract' flag.
      See Also:
    • FINAL_PROPERTY

      static final String FINAL_PROPERTY
      The property name for the 'final' flag.
      See Also:
    • LOCKED_PROPERTY

      static final String LOCKED_PROPERTY
      The property name for the 'locked' flag.
      See Also:
    • EXTENDED_TYPES_PROPERTY

      static final String EXTENDED_TYPES_PROPERTY
      The property name for the set of extended types.
      See Also:
    • PROPERTIES_PROPERTY

      static final String 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:
      getID in interface IdentifiableElement
      Returns:
      The UUID of the element.
    • setID

      void setID(UUID uuid)
      Sets the unique identifier (UUID) for the element.
      Specified by:
      setID in interface IdentifiableElement
      Parameters:
      uuid - The UUID to 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:
      getMetadata in interface IdentifiableElement
      Returns:
      The Metadata of the element, or null if none is set.
    • setMetadata

      void setMetadata(Metadata metadata)
      Sets the metadata for the element.
      Specified by:
      setMetadata in interface IdentifiableElement
      Parameters:
      metadata - The Metadata to 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:
      true if the type is abstract, false otherwise.
    • isFinal

      boolean isFinal()
      Checks if the type is final.
      Returns:
      true if the type is final, false otherwise.
    • 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 metadata already is, and the response reports the real value. It is true exactly for the types intrinsic to information-system-model itself, and false for every other type, including those contributed by a domain model on the classpath.

      Returns:
      true if the type definition is locked, false otherwise.
    • setLocked

      void setLocked(boolean locked)
      Sets whether this type's own definition is protected from modification and deletion.
      Parameters:
      locked - true to mark the type definition as locked, false otherwise.
    • getExtendedTypes

      List<String> getExtendedTypes()
      Returns the types that this type extends.

      A List because 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. A Set would 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 List because 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. A Set would map to an unordered store and lose it.

      Returns:
      The PropertyDefinitions, in declaration order.
    • getAccessType

      AccessType getAccessType()
      Returns the AccessType of 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.
    • setAdditionalProperty

      void setAdditionalProperty(String name, Object value)
      Sets an additional dynamic property.
      Parameters:
      name - the property name
      value - the property value