java.lang.Object
de.iip_ecosphere.platform.configuration.easyProducer.aas.AbstractAasElement
de.iip_ecosphere.platform.configuration.easyProducer.aas.AasType

public class AasType extends AbstractAasElement
Represents an AAS type, i.e., Submodel, SubmodelElementCollection, Entity.
Author:
Holger Eichelberger, SSE
  • Field Details

    • PARENT_AAS

      public static final String PARENT_AAS
      See Also:
    • allowDuplicates

      private boolean allowDuplicates
    • ordered

      private boolean ordered
    • fixedIdShort

      private boolean fixedIdShort
    • isMultiValued

      private boolean isMultiValued
    • smeType

      private AasSmeType smeType
    • parent

      private String parent
    • fields

      private List<AasField> fields
    • operations

      private List<AasOperation> operations
    • entityType

      private AasType.EntityType entityType
    • isAspect

      private boolean isAspect
    • mappedSemanticIds

      private Map<String,String> mappedSemanticIds
  • Constructor Details

    • AasType

      public AasType(String idShort, boolean fixedIdShort, boolean isMultiValued)
      Creates an AAS type.
      Parameters:
      idShort - the idShort of the type without multi-value counting suffix.
      fixedIdShort - whether the idShort shall always be stated as given
      isMultiValued - whether the type is multi-valued (with counting idShort)
    • AasType

      AasType(AasType type)
      Creates a new instance by deepely copying type.
      Parameters:
      type - the type
  • Method Details

    • isFixedIdShort

      public boolean isFixedIdShort()
      Returns whether the idShort shall always be stated as given.
      Returns:
      true if the idShort shall always be stated as given, false else
    • isMultiValued

      public boolean isMultiValued()
      Returns whether the type is multi-valued (with counting idShort).
      Returns:
      true if the type is multi-valued, false else
    • isAllowDuplicates

      public boolean isAllowDuplicates()
      Returns whether duplicates are allowed within the type.
      Returns:
      true for duplicates, false else
    • isAspect

      public boolean isAspect()
      Returns whether this type is an aspect (of it's AbstractAasElement.getIdShort()).
      Returns:
      whether this type is an aspect (of it's AbstractAasElement.getIdShort()) or not.
    • setAspect

      void setAspect(boolean isAspect)
      Changes the aspect flag.
      Parameters:
      isAspect - whether this type is an aspect (of it's AbstractAasElement.getIdShort()) or not.
    • setAllowDuplicates

      void setAllowDuplicates(boolean allowDuplicates)
      Defines whether duplicates are allowed within the type.
      Parameters:
      allowDuplicates - true for duplicates, false else
    • isOrdered

      public boolean isOrdered()
      Returns whether elements within the type are ordered.
      Returns:
      true for ordered, false else
    • setOrdered

      void setOrdered(boolean ordered)
      Defines whether elements within the type are ordered.
      Parameters:
      ordered - true for ordered, false else
    • setEntityType

      void setEntityType(AasType.EntityType entityType)
      Sets the entity type.
      Parameters:
      entityType - the entity type
    • getEntityType

      public AasType.EntityType getEntityType()
      Returns the entity type.
      Returns:
      the entity type
    • getSmeType

      public AasSmeType getSmeType()
      Returns the SME type.
      Returns:
      the SME type
    • setSmeType

      void setSmeType(AasSmeType smeType)
      Defines the SME type.
      Parameters:
      smeType - the SME type
    • setParent

      void setParent(String parent)
      Sets name of the parent, usually a submodel element collection, may be PARENT_AAS.
      Parameters:
      parent - the parent, may be PARENT_AAS to indicate an unspecified AAS as parent
      See Also:
    • getParent

      public String getParent()
      The name of the parent.
      Returns:
      the parent, may be PARENT_AAS
      See Also:
    • isAasParent

      public boolean isAasParent()
      Returns whether an AAS shall be the parent of the this type.
      Returns:
      true for AAS, false else
      See Also:
    • addOperation

      void addOperation(AasOperation operation)
      Adds an operation.
      Parameters:
      operation - the operation to be added (may be null, ignored then)
    • addField

      void addField(AasField field)
      Adds a field.
      Parameters:
      field - the field to be added (may be null, ignored then)
    • fields

      public Iterable<AasField> fields()
      Returns the fields of this type.
      Returns:
      the fields
    • hasFields

      public boolean hasFields()
      Returns whether this type has fields.
      Returns:
      true if there are fields, false else
    • getFieldsCount

      public int getFieldsCount()
      The number of fields declared for this type.
      Returns:
      the number of fields
    • operations

      public Iterable<AasOperation> operations()
      Returns the operations of this type.
      Returns:
      the operations
    • getOperationsCount

      public int getOperationsCount()
      The number of operations declared for this type.
      Returns:
      the number of operations
    • isLast

      boolean isLast(AasField field)
      Returns whether the given field is the last one in fields().
      Parameters:
      field - the field
      Returns:
      true for the last one, false else
    • setMappedSemanticIds

      void setMappedSemanticIds(Map<String,String> mappedSemanticIds)
      In case of isAspect(), set specific semanticIds per type. Sets the given value if there were no mapped semantic ids before, else merges them into the existing ones.
      Parameters:
      mappedSemanticIds - the mapped semantic IDs
    • getMappedSemanticId

      public String getMappedSemanticId(String idShort)
      In case of isAspect(), return a specific/mapped semanticId for the given type via its idShort.
      Parameters:
      idShort - the target idShort
      Returns:
      the specific/mapped semantic id or null for none
    • toString

      public String toString()
      Overrides:
      toString in class AbstractAasElement