Class BaSyxSubmodelElementCollection

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BaSyxSubmodelElementCollection.BaSyxSubmodelElementCollectionBuilder
      The sub-model element collection builder.
      • Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.SubmodelElementCollection

        de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection collection  
      private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.Builder<?>> deferred  
      private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.aas.SubmodelElement> elements  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaSyxSubmodelElementCollection()
      Creates an instance.
      protected BaSyxSubmodelElementCollection​(org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection collection)
      Creates an instance and sets the BaSyx instance directly.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)  
      de.iip_ecosphere.platform.support.aas.Reference createReference()  
      void deleteElement​(java.lang.String idShort)  
      java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> elements()  
      de.iip_ecosphere.platform.support.aas.DataElement getDataElement​(java.lang.String idShort)  
      de.iip_ecosphere.platform.support.aas.SubmodelElement getElement​(java.lang.String idShort)  
      private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
      T
      getElement​(java.lang.String idShort, java.lang.Class<T> type)
      getElement(String) combined with a type filter.
      protected java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> getElements​(java.util.function.Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElement> filter)
      Returns an iterable of submodel elements complying to a given predicate.
      protected <E extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
      java.lang.Iterable<E>
      getElements​(java.util.function.Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElement> filter, java.lang.Class<E> castType)
      Returns an iterable of submodel elements complying to a given predicate and a given target cast type.
      int getElementsCount()  
      java.lang.String getIdShort()  
      de.iip_ecosphere.platform.support.aas.Operation getOperation​(java.lang.String idShort)  
      de.iip_ecosphere.platform.support.aas.Property getProperty​(java.lang.String idShort)  
      de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement​(java.lang.String idShort)  
      org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection getSubmodelElement()
      Returns the implementing sub-model element.
      de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection​(java.lang.String idShort)  
      protected java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> getSubmodelElementCollections​(java.util.function.Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> filter)
      Returns an iterable of submodel element collections complying to a given predicate.
      private void initialize()
      Dynamically initializes the elements structure.
      <D extends org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.DataElement>
      BaSyxDataElement<D>
      register​(BaSyxDataElement<D> dataElement)
      Registers a data element.
      BaSyxFile register​(BaSyxFile file)
      Registers a file data element.
      BaSyxOperation register​(BaSyxOperation operation)
      Registers an operation.
      BaSyxProperty register​(BaSyxProperty property)
      Registers a property.
      BaSyxReferenceElement register​(BaSyxReferenceElement reference)
      Registers a reference element.
      BaSyxSubmodelElementCollection register​(BaSyxSubmodelElementCollection collection)
      Registers a sub-model element collection.
      void update()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • collection

        private org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection collection
      • elements

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.aas.SubmodelElement> elements
      • deferred

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.Builder<?>> deferred
    • Constructor Detail

      • BaSyxSubmodelElementCollection

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

        protected BaSyxSubmodelElementCollection​(org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection collection)
        Creates an instance and sets the BaSyx instance directly.
        Parameters:
        collection - the collection instance
    • Method Detail

      • 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
      • elements

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

        protected java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> getElements​(java.util.function.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> java.lang.Iterable<E> getElements​(java.util.function.Predicate<de.iip_ecosphere.platform.support.aas.SubmodelElement> filter,
                                                                                                                      java.lang.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 java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElementCollection> getSubmodelElementCollections​(java.util.function.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
      • getIdShort

        public java.lang.String getIdShort()
        Specified by:
        getIdShort in interface de.iip_ecosphere.platform.support.aas.Element
      • getSubmodelElement

        public org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection 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​(java.lang.String idShort)
        Specified by:
        getDataElement in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
      • getProperty

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

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

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

        public de.iip_ecosphere.platform.support.aas.SubmodelElement getElement​(java.lang.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​(java.lang.String idShort,
                                                                                               java.lang.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​(java.lang.String idShort)
        Specified by:
        getSubmodelElementCollection in interface de.iip_ecosphere.platform.support.aas.ElementsAccess
      • accept

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

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

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

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