Class AssetSchemaAttribute

  • All Implemented Interfaces:
    Serializable

    public class AssetSchemaAttribute
    extends AssetReferenceable

    SchemaAttribute describes a single attribute within a schema. The attribute has a name, order in the schema and cardinality. Its type is another SchemaElement of type SchemaType. SchemaType has many

    See Also:
    Serialized Form
    • Constructor Detail

      • AssetSchemaAttribute

        protected AssetSchemaAttribute​(SchemaAttribute schemaAttributeBean)
        Bean constructor used by subclasses
        Parameters:
        schemaAttributeBean - bean containing all of the properties
      • AssetSchemaAttribute

        public AssetSchemaAttribute​(AssetDescriptor parentAsset,
                                    SchemaAttribute schemaAttributeBean)
        Bean constructor with parent asset
        Parameters:
        parentAsset - description of the asset that this schema attribute is attached to.
        schemaAttributeBean - bean containing all of the properties
      • AssetSchemaAttribute

        public AssetSchemaAttribute​(AssetDescriptor parentAsset,
                                    AssetSchemaAttribute template)
        Copy/clone constructor.
        Parameters:
        parentAsset - description of the asset that this schema attribute is attached to.
        template - template schema attribute to copy.
    • Method Detail

      • getSchemaAttributeBean

        protected SchemaAttribute getSchemaAttributeBean()
        Return the bean with all of the properties.
        Returns:
        schema attribute bean
      • getAttributeName

        public String getAttributeName()
        Return the name of this schema attribute.
        Returns:
        String attribute name
      • getElementPosition

        public int getElementPosition()
        Return the position of this schema attribute in its parent schema.
        Returns:
        int position in schema 0 means first
      • getCategory

        public SchemaAttributeCategory getCategory()
        Return the category of the schema attribute.
        Returns:
        enum SchemaAttributeCategory
      • getCardinality

        public String getCardinality()
        Return the cardinality defined for this schema attribute.
        Returns:
        String cardinality defined for this schema attribute.
      • getMinCardinality

        public int getMinCardinality()
        Return this minimum number of instances allowed for this attribute.
        Returns:
        int
      • getMaxCardinality

        public int getMaxCardinality()
        Return the maximum number of instances allowed for this attribute.
        Returns:
        int (-1 means infinite)
      • allowsDuplicateValues

        public boolean allowsDuplicateValues()
        Return whether the same value can be used by more than one instance of this attribute.
        Returns:
        boolean flag
      • hasOrderedValues

        public boolean hasOrderedValues()
        Return whether the attribute instances are arranged in an order.
        Returns:
        boolean flag
      • getSortOrder

        public DataItemSortOrder getSortOrder()
        Return the order that the attribute instances are arranged in - if any.
        Returns:
        DataItemSortOrder enum
      • getDefaultValueOverride

        public String getDefaultValueOverride()
        Return any default value for this attribute that would override the default defined in the schema element for this attribute's type (note only used is type is primitive).
        Returns:
        String default value override
      • getLocalSchemaType

        @Deprecated
        public AssetSchemaType getLocalSchemaType()
        Deprecated.
        Return the SchemaType that relates to the type of this attribute. It is possible to query its type and cast it to specific types of schema type to retrieve all of the values.
        Returns:
        SchemaType object
      • getAttributeType

        public AssetSchemaType getAttributeType()
        Return the SchemaType that relates to the type of this attribute. It is possible to query its type and cast it to specific types of schema type to retrieve all of the values.
        Returns:
        SchemaType object
      • getAttributeRelationships

        public List<AssetSchemaAttributeRelationship> getAttributeRelationships()
        Return any relationships to other schema attributes. This could be relationships in a Graph or foreign key relationships in a relational schema
        Returns:
        list of attribute relationships
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class AssetReferenceable
        Returns:
        print out of variables in a JSON-style
      • equals

        public boolean equals​(Object objectToCompare)
        Compare the values of the supplied object with those stored in the current object.
        Overrides:
        equals in class AssetReferenceable
        Parameters:
        objectToCompare - supplied object
        Returns:
        boolean result of comparison