Class BaSyxSubmodelElementCollection
- java.lang.Object
-
- de.iip_ecosphere.platform.support.aas.basyx.BaSyxSubmodelElement
-
- de.iip_ecosphere.platform.support.aas.basyx.BaSyxSubmodelElementCollection
-
- All Implemented Interfaces:
BaSyxElementTranslator.SubmodelElementsRegistrar,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
- Direct Known Subclasses:
BaSyxFurtherInformation,BaSyxGeneralInformation,BaSyxProductClassificationItem,BaSyxProductClassifications,BaSyxTechnicalProperties
public class BaSyxSubmodelElementCollection extends BaSyxSubmodelElement implements de.iip_ecosphere.platform.support.aas.SubmodelElementCollection, BaSyxElementTranslator.SubmodelElementsRegistrar
Wrapper for the BaSyx sub-model element collection.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaSyxSubmodelElementCollection.BaSyxSubmodelElementCollectionBuilderThe sub-model element collection builder.
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollectioncollectionprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.Builder<?>>deferredprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.SubmodelElement>elements
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaSyxSubmodelElementCollection()Creates an instance.protectedBaSyxSubmodelElementCollection(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 voidaccept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)de.iip_ecosphere.platform.support.aas.ReferencecreateReference()voiddeleteElement(java.lang.String idShort)java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement>elements()de.iip_ecosphere.platform.support.aas.DataElementgetDataElement(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.SubmodelElementgetElement(java.lang.String idShort)private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
TgetElement(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.intgetElementsCount()java.lang.StringgetIdShort()de.iip_ecosphere.platform.support.aas.OperationgetOperation(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.PropertygetProperty(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.ReferenceElementgetReferenceElement(java.lang.String idShort)org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollectiongetSubmodelElement()Returns the implementing sub-model element.de.iip_ecosphere.platform.support.aas.SubmodelElementCollectiongetSubmodelElementCollection(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 voidinitialize()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.BaSyxFileregister(BaSyxFile file)Registers a file data element.BaSyxOperationregister(BaSyxOperation operation)Registers an operation.BaSyxPropertyregister(BaSyxProperty property)Registers a property.BaSyxReferenceElementregister(BaSyxReferenceElement reference)Registers a reference element.BaSyxSubmodelElementCollectionregister(BaSyxSubmodelElementCollection collection)Registers a sub-model element collection.voidupdate()
-
-
-
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:
getElementsCountin interfacede.iip_ecosphere.platform.support.aas.SubmodelElementCollection
-
elements
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> elements()
- Specified by:
elementsin interfacede.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 filtercastType- 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:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.Element
-
getSubmodelElement
public org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElementCollection getSubmodelElement()
Description copied from class:BaSyxSubmodelElementReturns the implementing sub-model element.- Specified by:
getSubmodelElementin classBaSyxSubmodelElement- Returns:
- the submodel element
-
getDataElement
public de.iip_ecosphere.platform.support.aas.DataElement getDataElement(java.lang.String idShort)
- Specified by:
getDataElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getProperty
public de.iip_ecosphere.platform.support.aas.Property getProperty(java.lang.String idShort)
- Specified by:
getPropertyin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getOperation
public de.iip_ecosphere.platform.support.aas.Operation getOperation(java.lang.String idShort)
- Specified by:
getOperationin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getReferenceElement
public de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement(java.lang.String idShort)
- Specified by:
getReferenceElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getElement
public de.iip_ecosphere.platform.support.aas.SubmodelElement getElement(java.lang.String idShort)
- Specified by:
getElementin interfacede.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 fortype- 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:
getSubmodelElementCollectionin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
register
public BaSyxProperty register(BaSyxProperty property)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a property.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
property- the property- Returns:
property
-
register
public BaSyxFile register(BaSyxFile file)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a file data element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
file- the file data element- Returns:
file
-
register
public BaSyxOperation register(BaSyxOperation operation)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters an operation.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
operation- the operation- Returns:
operation
-
register
public BaSyxReferenceElement register(BaSyxReferenceElement reference)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a reference element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
reference- the reference- Returns:
reference
-
register
public BaSyxSubmodelElementCollection register(BaSyxSubmodelElementCollection collection)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a sub-model element collection.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
collection- the collection- Returns:
collection
-
register
public <D extends org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.DataElement> BaSyxDataElement<D> register(BaSyxDataElement<D> dataElement)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a data element.- Specified by:
registerin interfaceBaSyxElementTranslator.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:
acceptin interfacede.iip_ecosphere.platform.support.aas.Element
-
createReference
public de.iip_ecosphere.platform.support.aas.Reference createReference()
- Specified by:
createReferencein interfacede.iip_ecosphere.platform.support.aas.SubmodelElementCollection
-
deleteElement
public void deleteElement(java.lang.String idShort)
- Specified by:
deleteElementin interfacede.iip_ecosphere.platform.support.aas.SubmodelElementCollection
-
update
public void update()
- Specified by:
updatein interfacede.iip_ecosphere.platform.support.aas.Element- Overrides:
updatein classBaSyxSubmodelElement
-
-