Class BaSyxSubmodelElementCollection

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.BaSyxSubmodelElement
de.iip_ecosphere.platform.support.aas.basyx2.BaSyxSubmodelElementCollection
All Implemented Interfaces:
BaSyxElementTranslator.SubmodelElementsRegistrar, BaSyxSubmodelElementParent, de.iip_ecosphere.platform.support.aas.Element, de.iip_ecosphere.platform.support.aas.ElementsAccess, de.iip_ecosphere.platform.support.aas.HasDataSpecification, de.iip_ecosphere.platform.support.aas.HasKind, de.iip_ecosphere.platform.support.aas.HasSemantics, de.iip_ecosphere.platform.support.aas.Qualifiable, de.iip_ecosphere.platform.support.aas.Referable, de.iip_ecosphere.platform.support.aas.SubmodelElement, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection

public class BaSyxSubmodelElementCollection extends BaSyxSubmodelElement implements de.iip_ecosphere.platform.support.aas.SubmodelElementCollection, BaSyxElementTranslator.SubmodelElementsRegistrar, BaSyxSubmodelElementParent
Wrapper for the BaSyx sub-model element collection.
Author:
Holger Eichelberger, SSE
  • Field Details

    • collection

      private org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection collection
    • elementsMap

      private Map<String,de.iip_ecosphere.platform.support.aas.SubmodelElement> elementsMap
    • elementsList

      private List<de.iip_ecosphere.platform.support.aas.SubmodelElement> elementsList
    • deferred

      private Map<String,de.iip_ecosphere.platform.support.Builder<?>> deferred
  • Constructor Details

    • BaSyxSubmodelElementCollection

      protected BaSyxSubmodelElementCollection()
      Creates an instance. Prevents external creation.
    • BaSyxSubmodelElementCollection

      protected BaSyxSubmodelElementCollection(org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection collection)
      Creates an instance and sets the BaSyx instance directly.
      Parameters:
      collection - the collection instance
  • Method Details

    • addSubmodelElement

      static void addSubmodelElement(org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection collection, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement element)
      Adds a submodel element.
      Parameters:
      collection - the collection to add the element to
      element - the element to add
    • createElementsStructure

      private void createElementsStructure()
      Creates the actual data structure to use. collection shall be set before.
    • initialize

      private void initialize()
      Dynamically initializes the elements structure.
    • getElementsCount

      public int getElementsCount()
      Specified by:
      getElementsCount in interface de.iip_ecosphere.platform.support.aas.SubmodelElementCollection
    • submodelElements

      public Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements()
      Specified by:
      submodelElements in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • elements

      public Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> elements()
      Specified by:
      elements in interface de.iip_ecosphere.platform.support.aas.SubmodelElementCollection
    • elementsCollection

      private Collection<de.iip_ecosphere.platform.support.aas.SubmodelElement> elementsCollection()
      Returns the elements as collection.
      Returns:
      the collection
    • elementsStream

      private Stream<de.iip_ecosphere.platform.support.aas.SubmodelElement> elementsStream()
      Returns the elements as stream.
      Returns:
      the stream
      See Also:
    • add

      private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> T add(T elt)
      Adds an element.
      Type Parameters:
      T - the actual type of the element
      Parameters:
      elt - the element
      Returns:
      elt
    • getElements

      protected Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> getElements(Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElement> filter)
      Returns an iterable of submodel elements complying to a given predicate.
      Parameters:
      filter - the filter
      Returns:
      the iterable
    • getElements

      protected <E extends de.iip_ecosphere.platform.support.aas.SubmodelElement> Iterable<E> getElements(Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElement> filter, Class<E> castType)
      Returns an iterable of submodel elements complying to a given predicate and a given target cast type.
      Type Parameters:
      E - the type of submodel element
      Parameters:
      filter - the filter
      castType - the type to filter for and cast to
      Returns:
      the iterable
    • getSubmodelElementCollections

      protected Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> getSubmodelElementCollections(Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> filter)
      Returns an iterable of submodel element collections complying to a given predicate.
      Parameters:
      filter - the filter
      Returns:
      the iterable
    • getSubmodelElement

      public org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection getSubmodelElement()
      Description copied from class: BaSyxSubmodelElement
      Returns the implementing sub-model element.
      Specified by:
      getSubmodelElement in class BaSyxSubmodelElement
      Returns:
      the submodel element
    • getDataElement

      public de.iip_ecosphere.platform.support.aas.DataElement getDataElement(String idShort)
      Specified by:
      getDataElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getProperty

      public de.iip_ecosphere.platform.support.aas.Property getProperty(String idShort)
      Specified by:
      getProperty in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getOperation

      public de.iip_ecosphere.platform.support.aas.Operation getOperation(String idShort)
      Specified by:
      getOperation in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getReferenceElement

      public de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement(String idShort)
      Specified by:
      getReferenceElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getRelationshipElement

      public de.iip_ecosphere.platform.support.aas.RelationshipElement getRelationshipElement(String idShort)
      Specified by:
      getRelationshipElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getSubmodelElement

      public de.iip_ecosphere.platform.support.aas.SubmodelElement getSubmodelElement(String idShort)
      Specified by:
      getSubmodelElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getElement

      public de.iip_ecosphere.platform.support.aas.SubmodelElement getElement(String idShort)
      Specified by:
      getElement in interface de.iip_ecosphere.platform.support.aas.SubmodelElementCollection
    • getElement

      private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> T getElement(String idShort, Class<T> type)
      getElement(String) combined with a type filter.
      Type Parameters:
      T - the type
      Parameters:
      idShort - the short id to search for
      type - the class representing the type
      Returns:
      the element with given type or null for none
    • getSubmodelElementCollection

      public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection(String idShort)
      Specified by:
      getSubmodelElementCollection in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getSubmodelElementList

      public de.iip_ecosphere.platform.support.aas.SubmodelElementList getSubmodelElementList(String idShort)
      Specified by:
      getSubmodelElementList in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • getEntity

      public de.iip_ecosphere.platform.support.aas.Entity getEntity(String idShort)
      Specified by:
      getEntity in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • registerElement

      public <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> T registerElement(T elt)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers an element. Default for all remaining registration functions in this interface.
      Specified by:
      registerElement in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Type Parameters:
      T - the actual type of the element
      Parameters:
      elt - the element
      Returns:
      elt
    • register

      public BaSyxProperty register(BaSyxProperty property)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a property.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      property - the property
      Returns:
      property
    • register

      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a multi-language property.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      property - the property
      Returns:
      property
    • register

      public BaSyxBlob register(BaSyxBlob blob)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a BLOB data element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      blob - the BLOB data element
      Returns:
      blob
    • register

      public BaSyxFile register(BaSyxFile file)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a file data element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      file - the file data element
      Returns:
      file
    • register

      public BaSyxRange register(BaSyxRange range)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a range element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      range - the range element
      Returns:
      range
    • register

      public BaSyxOperation register(BaSyxOperation operation)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers an operation.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      operation - the operation
      Returns:
      operation
    • register

      public BaSyxRelationshipElement register(BaSyxRelationshipElement relationship)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a relationship element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      relationship - the relationship element
      Returns:
      relationship
    • register

      public BaSyxReferenceElement register(BaSyxReferenceElement reference)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a reference element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      reference - the reference
      Returns:
      reference
    • register

      public BaSyxEntity register(BaSyxEntity reference)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers an entity.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      reference - the entity
      Returns:
      entity
    • register

      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a sub-model element collection.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      collection - the collection
      Returns:
      collection
    • register

      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a sub-model element list.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Parameters:
      list - the list
      Returns:
      collection
    • register

      public <D extends org.eclipse.digitaltwin.aas4j.v3.model.DataElement> BaSyxDataElement<D> register(BaSyxDataElement<D> dataElement)
      Description copied from interface: BaSyxElementTranslator.SubmodelElementsRegistrar
      Registers a data element.
      Specified by:
      register in interface BaSyxElementTranslator.SubmodelElementsRegistrar
      Type Parameters:
      D - the element type
      Parameters:
      dataElement - the element to register
      Returns:
      dataElement
    • accept

      public void accept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)
      Specified by:
      accept in interface de.iip_ecosphere.platform.support.aas.Element
      Specified by:
      accept in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • createReference

      public de.iip_ecosphere.platform.support.aas.Reference createReference()
      Specified by:
      createReference in interface de.iip_ecosphere.platform.support.aas.SubmodelElementCollection
    • deleteSubmodelElement

      void deleteSubmodelElement(String idShort, de.iip_ecosphere.platform.support.aas.SubmodelElement element)
      Removes a submodel element through its idShort.
      Parameters:
      idShort - the idshort to remove
    • deleteElement

      public void deleteElement(String idShort)
      Specified by:
      deleteElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
    • update

      public void update()
      Specified by:
      update in interface de.iip_ecosphere.platform.support.aas.Element
      Overrides:
      update in class BaSyxSubmodelElement
    • getPathElement

      public org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement getPathElement()
      Description copied from interface: BaSyxSubmodelElementParent
      Specified by:
      getPathElement in interface BaSyxSubmodelElementParent
      Returns:
      the path element