Class FakeSubmodel
- java.lang.Object
-
- test.de.iip_ecosphere.platform.support.fakeAas.FakeElement
-
- test.de.iip_ecosphere.platform.support.fakeAas.FakeSubmodel
-
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.DeferredParent,de.iip_ecosphere.platform.support.aas.Element,de.iip_ecosphere.platform.support.aas.ElementContainer,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.Identifiable,de.iip_ecosphere.platform.support.aas.Qualifiable,de.iip_ecosphere.platform.support.aas.Referable,de.iip_ecosphere.platform.support.aas.Submodel
public class FakeSubmodel extends FakeElement implements de.iip_ecosphere.platform.support.aas.Submodel
A fake (inefficient) submodel.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classFakeSubmodel.FakeSubmodelBuilderA fake sub-model builder.
-
Field Summary
Fields Modifier and Type Field Description private 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>elementsprivate java.lang.Stringidentifierprivate FakeAasparent
-
Constructor Summary
Constructors Modifier Constructor Description protectedFakeSubmodel(java.lang.String idShort, java.lang.String identifier)Creates the instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)voidbuildDeferred()de.iip_ecosphere.platform.support.aas.ReferencecreateReference()de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuildercreateSubmodelElementCollectionBuilder(java.lang.String idShort, boolean ordered, boolean allowDuplicates)java.lang.Iterable<de.iip_ecosphere.platform.support.aas.DataElement>dataElements()(package private) voiddefer(java.lang.String shortId, de.iip_ecosphere.platform.support.Builder<?> builder)Registers a sub-build as deferred.voiddelete(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
java.util.List<T>filter(java.lang.Class<T> type)Filters#elements()for the given type.private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
Tfilter(java.lang.String idShort, java.lang.Class<T> type)Filters#submodelElements()for the given short id and type.de.iip_ecosphere.platform.support.aas.DataElementgetDataElement(java.lang.String idShort)intgetDataElementsCount()(package private) <B extends de.iip_ecosphere.platform.support.Builder<?>>
BgetDeferred(java.lang.String shortId, java.lang.Class<B> cls)Returns a deferred builder.java.lang.StringgetIdentification()de.iip_ecosphere.platform.support.aas.OperationgetOperation(java.lang.String idShort)intgetOperationsCount()intgetPropertiesCount()de.iip_ecosphere.platform.support.aas.PropertygetProperty(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.ReferenceElementgetReferenceElement(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.SubmodelElementgetSubmodelElement(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.SubmodelElementCollectiongetSubmodelElementCollection(java.lang.String idShort)intgetSubmodelElementsCount()java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Operation>operations()java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Property>properties()java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement>submodelElements()-
Methods inherited from class test.de.iip_ecosphere.platform.support.fakeAas.FakeElement
getIdShort, update
-
-
-
-
Field Detail
-
parent
private FakeAas parent
-
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
-
identifier
private java.lang.String identifier
-
-
Constructor Detail
-
FakeSubmodel
protected FakeSubmodel(java.lang.String idShort, java.lang.String identifier)Creates the instance.- Parameters:
idShort- the short id.identifier- the identifier of the sub-model (may be null or empty for an identification based onidShort, interpreted as an URN if this starts withurn)
-
-
Method Detail
-
accept
public void accept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)
- Specified by:
acceptin interfacede.iip_ecosphere.platform.support.aas.Element
-
submodelElements
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements()
- Specified by:
submodelElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getSubmodelElementsCount
public int getSubmodelElementsCount()
- Specified by:
getSubmodelElementsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
filter
private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> java.util.List<T> filter(java.lang.Class<T> type)
Filters#elements()for the given type.- Type Parameters:
T- the element type to return- Parameters:
type- the element type- Returns:
- the found element or null
-
filter
private <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> T filter(java.lang.String idShort, java.lang.Class<T> type)Filters#submodelElements()for the given short id and type.- Type Parameters:
T- the element type to return- Parameters:
idShort- the short idtype- the element type- Returns:
- the found element or null
-
dataElements
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.DataElement> dataElements()
- Specified by:
dataElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
properties
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Property> properties()
- Specified by:
propertiesin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getDataElementsCount
public int getDataElementsCount()
- Specified by:
getDataElementsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
operations
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Operation> operations()
- Specified by:
operationsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getOperationsCount
public int getOperationsCount()
- Specified by:
getOperationsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getPropertiesCount
public int getPropertiesCount()
- Specified by:
getPropertiesCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
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
-
getReferenceElement
public de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement(java.lang.String idShort)
- Specified by:
getReferenceElementin 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
-
getSubmodelElement
public de.iip_ecosphere.platform.support.aas.SubmodelElement getSubmodelElement(java.lang.String idShort)
- Specified by:
getSubmodelElementin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getSubmodelElementCollection
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection(java.lang.String idShort)
- Specified by:
getSubmodelElementCollectionin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
createSubmodelElementCollectionBuilder
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder createSubmodelElementCollectionBuilder(java.lang.String idShort, boolean ordered, boolean allowDuplicates)- Specified by:
createSubmodelElementCollectionBuilderin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
createReference
public de.iip_ecosphere.platform.support.aas.Reference createReference()
- Specified by:
createReferencein interfacede.iip_ecosphere.platform.support.aas.Submodel
-
delete
public void delete(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)
- Specified by:
deletein interfacede.iip_ecosphere.platform.support.aas.Submodel
-
defer
void defer(java.lang.String shortId, de.iip_ecosphere.platform.support.Builder<?> builder)Registers a sub-build as deferred.- Parameters:
shortId- the shortId of the elementbuilder- the sub-builder to be registered- See Also:
buildDeferred()
-
buildDeferred
public void buildDeferred()
- Specified by:
buildDeferredin interfacede.iip_ecosphere.platform.support.aas.DeferredParent
-
getDeferred
<B extends de.iip_ecosphere.platform.support.Builder<?>> B getDeferred(java.lang.String shortId, java.lang.Class<B> cls)Returns a deferred builder.- Type Parameters:
B- the builder type- Parameters:
shortId- the short idcls- the builder type- Returns:
- the builder or null if no builder for
shortIdwith the respective type is registered
-
getIdentification
public java.lang.String getIdentification()
- Specified by:
getIdentificationin interfacede.iip_ecosphere.platform.support.aas.Identifiable
-
-