Class TypeUsage


  • public class TypeUsage
    extends Object
    Static Composition/Association/Property usage data for a Type -- i.e. which other types declare, in the schema, that they reference this one; not to be confused with a possible future effective/dynamic usage (which types actually have live instances referencing this one, sourced from the graph database rather than the schema -- tracked separately, under its own property name, once designed; not part of this class).

    Pure data: how a TypeUsage is built from a ModelKnowledge and attached to a Type is not this class's concern -- see TypeUsageBuilder.

    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • TypeUsage

        public TypeUsage()
    • Method Detail

      • getCompositionUsage

        public List<LinkedEntity> getCompositionUsage()
        Returns the Composition Usage entries (e.g. a Resource's own ConsistsOf declarations, or a Facet's/ConsistsOf relation's incoming usage), or null if not applicable to this type's AccessType.
        Returns:
        The composition usage entries, or null.
      • setCompositionUsage

        public void setCompositionUsage​(List<LinkedEntity> compositionUsage)
        Sets the Composition Usage entries.
        Parameters:
        compositionUsage - The composition usage entries.
      • getAssociationUsage

        public List<LinkedEntity> getAssociationUsage()
        Returns the Association Usage entries (e.g. a Resource's or an IsRelatedTo relation's usage, either side), or null if not applicable to this type's AccessType.
        Returns:
        The association usage entries, or null.
      • setAssociationUsage

        public void setAssociationUsage​(List<LinkedEntity> associationUsage)
        Sets the Association Usage entries.
        Parameters:
        associationUsage - The association usage entries.
      • setPropertyUsage

        public void setPropertyUsage​(List<Map.Entry<String,​PropertyDefinition>> propertyUsage)
        Sets the Known Usage entries for a Property-family type.
        Parameters:
        propertyUsage - The property usage entries.